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

Participant ,
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

57

Likes

Translate

Translate

Report

Report
Reply
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

Enthusiast , Aug 09, 2020
Nesa Nurani Enthusiast , 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";}elseevent.value = "";

Likes

Translate

Translate
Jump to answer Jump to answer
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
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
first.officer AUTHOR LATEST
Participant ,
Aug 09, 2020

Copy link to clipboard

Copied

Thanks Nesa....thats great 😉

Likes

Translate

Translate

Report

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