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

Explorer ,
Aug 09, 2020

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

Enthusiast
| Enthusiast

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

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

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

Enthusiast
| Enthusiast

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

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

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

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

Copied

Thanks Nesa....thats great 😉

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