Java Script Issue: auto populate "Yes or No" Value.

New Here ,
Sep 09, 2018 Sep 09, 2018

Copy link to clipboard

Copied

I am trying to create a java script to auto populate a yes or no value in one field based on a value in another field. I tried the following script, but it did not work:

if(Depth To Water ft2 <= 20.20) {     Submerged YN2 = "Yes"; } else {     Submerged YN2 = "No"; }

TOPICS
Acrobat SDK and JavaScript, Windows

Views

85

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
community guidelines
Most Valuable Participant ,
Sep 09, 2018 Sep 09, 2018

Copy link to clipboard

Copied

LATEST

Use this code as the custom calculation script of "Submerged YN2":

var v = Number(this.getField("Depth To Water ft2").valueAsString);

event.value = (v<=20.20) ? "Yes" : "No";

Edit: fixed the code a bit...

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
community guidelines