• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers

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

Translate

Translate

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 guidelines

correct answers 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

Translate

Translate
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

Translate

Translate

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 guidelines
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

Translate

Translate

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 guidelines