## Adobe Support Community

• Global community
• Language:
• Deutsch
• English
• EspaĆ±ol
• FranĆ§ais
• PortuguĆŖs
• ę„ę¬čŖć³ćć„ććć£
Dedicated community for Japanese speakers
• ķźµ­ ģ»¤ė®¤ėķ°
Dedicated community for Korean speakers
• Re: Using an If then statement to populate a 3rd f...

# Using an If then statement to populate a 3rd field

Community Beginner ,
Aug 31, 2022 Aug 31, 2022

Copy link to clipboard

Copied

Hi,

So I am creating a form where we measure the angle of a 2 sided object. There are 2 fields (Side A & Side B) that data is inputted. What I am trying to do is create a statement for the 3rd field that if Side A is less then .10 and Side B is less then .10 then Column C populates "Pass" otherwise if either Side A or B is greater then .10 then Column C populates "Fail"

Its been forever since I've had to create something like this so I'm not even sure where to start. Any help would be appreciated!

TOPICS
JavaScript , PDF forms

Views

55

Likes

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

## 1 Correct answer

Community Expert , Aug 31, 2022 Aug 31, 2022

What should happen if both are equal to .10 ?

You can try something like this as custom calculation script of 'Column C' field:

var sa = this.getField("Side A").value;
var sb = this.getField("Side B").value;
if(sa&&sb){
if(Number(sa)< .10 && Number(sb)< .10)
event.value = "Pass";
else if(Number(sa)> .10 || Number(sb)> .10)
event.value = "Fail";}
else
event.value = "";

Likes

2 Replies 2
Adobe Employee ,
Aug 31, 2022 Aug 31, 2022

Copy link to clipboard

Copied

Hello @QA Manager,

I hope you are doing well.

Per the description, I understand that you want to add a calculative text field using scripts.

You may refer to the given link and check if it helps you:

if/then statement in text box Adobe Acrobat X Pro (JavaScript) (acrobatusers.com)

Let me know if this helps.

Thanks,

Souvik.

Likes

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Community Expert ,
Aug 31, 2022 Aug 31, 2022

Copy link to clipboard

Copied

LATEST

What should happen if both are equal to .10 ?

You can try something like this as custom calculation script of 'Column C' field:

var sa = this.getField("Side A").value;
var sb = this.getField("Side B").value;
if(sa&&sb){
if(Number(sa)< .10 && Number(sb)< .10)
event.value = "Pass";
else if(Number(sa)> .10 || Number(sb)> .10)
event.value = "Fail";}
else
event.value = "";

Likes

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Resources
About Adobe Acrobat
Adobe Acrobat Feature & Workflow
FAQs