• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

230

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
Community Expert ,
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...

Votes

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