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

Comparing Field 'A' value with Field 'B' value...

Engaged ,
Aug 09, 2020 Aug 09, 2020

Copy link to clipboard

Copied

Hi,

 

Am trying to come up with the script to compare the numerical value in Field 'A', and compare it to the numerical value in Field 'B', and if numerical value 'A' is greater than numerical value 'B', add text "NO", and if numerical value 'A' is less than value 'B', add text "YES" (otherwise field is blank). The "YES" or "NO" would be added to a field 'C'.

 

I'm sure its fairly straightforward, but can't seem to fathom....

TOPICS
PDF forms

Views

345

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 09, 2020 Aug 09, 2020

Use this code as FieldC "Custom Calculation Script":

 

var a = this.getField("FieldA").value;
var b = this.getField("FieldB").value;
if(a > b){
event.value = "NO";
}else if(a < b){
event.value = "YES";
}else
event.value = "";

Votes

Translate

Translate
Community Expert ,
Aug 09, 2020 Aug 09, 2020

Copy link to clipboard

Copied

Use this code as FieldC "Custom Calculation Script":

 

var a = this.getField("FieldA").value;
var b = this.getField("FieldB").value;
if(a > b){
event.value = "NO";
}else if(a < b){
event.value = "YES";
}else
event.value = "";

Votes

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
Engaged ,
Aug 09, 2020 Aug 09, 2020

Copy link to clipboard

Copied

LATEST

Thanks Nesa....thats great 😉

Votes

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