Calculation: If this and this are true, then 'YES'; else 'NO'

New Here ,
Oct 31, 2019

Copy link to clipboard

Copied

I would like to create a YES or NO answer in a text field using 2 conditions.

 

if 'TotalFamSize' = 1

and 

the value of 'TotalFam6MoInc' <= the value of 'Six-Month Inc1'

then

'Level1Met' value is "YES"

else value is "NO"

 

Thanks for any help you can share.

 

 

 

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

As the custom calculation script of Level1Met enter this code:

 

 

if (this.getField("TotalFamSize").valueAsString=="1" && (Number(this.getField("TotalFam6MoInc").valueAsString) <= Number(this.getField("Six-Month Inc1").valueAsString))) 
	event.value = "YES";
else event.value = "NO";

 

TOPICS
Acrobat SDK and JavaScript, PDF forms, Windows

Views

49

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

Calculation: If this and this are true, then 'YES'; else 'NO'

New Here ,
Oct 31, 2019

Copy link to clipboard

Copied

I would like to create a YES or NO answer in a text field using 2 conditions.

 

if 'TotalFamSize' = 1

and 

the value of 'TotalFam6MoInc' <= the value of 'Six-Month Inc1'

then

'Level1Met' value is "YES"

else value is "NO"

 

Thanks for any help you can share.

 

 

 

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

As the custom calculation script of Level1Met enter this code:

 

 

if (this.getField("TotalFamSize").valueAsString=="1" && (Number(this.getField("TotalFam6MoInc").valueAsString) <= Number(this.getField("Six-Month Inc1").valueAsString))) 
	event.value = "YES";
else event.value = "NO";

 

TOPICS
Acrobat SDK and JavaScript, PDF forms, Windows

Views

50

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
Oct 31, 2019 0
Most Valuable Participant ,
Oct 31, 2019

Copy link to clipboard

Copied

As the custom calculation script of Level1Met enter this code:

 

 

if (this.getField("TotalFamSize").valueAsString=="1" && (Number(this.getField("TotalFam6MoInc").valueAsString) <= Number(this.getField("Six-Month Inc1").valueAsString))) 
	event.value = "YES";
else event.value = "NO";

 

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...
Oct 31, 2019 1
hblood LATEST
New Here ,
Oct 31, 2019

Copy link to clipboard

Copied

This worked perfectly.  Thank you!

I can now use this for the additional 9 levels by changing the .valueAsString and the field references.

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...
Oct 31, 2019 0