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

Explorer ,
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....

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 = "";

TOPICS
PDF forms

Views

37

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

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

Explorer ,
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....

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 = "";

TOPICS
PDF forms

Views

38

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
Aug 09, 2020 0
Enthusiast ,
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 = "";

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
Reply
Loading...
Aug 09, 2020 0
Explorer ,
Aug 09, 2020

Copy link to clipboard

Copied

Thanks Nesa....thats great 😉

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
Reply
Loading...
Aug 09, 2020 0