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

populate and show field2 only if field1 is populated otherwise hide field2 and not populate

Participant ,
Jul 30, 2019 Jul 30, 2019

Copy link to clipboard

Copied

Believe or not but I couldn't find the answer. I have two fields. Field1 and Field2. Field1 calculates. If and when Field1 is populated then I would like to show and populate Field2 with a phrase, not the total from Field1. Then if Field1 is not populated then to hide and reset Field2. Can someone help me solve this? Thank you all.

TOPICS
Acrobat SDK and JavaScript , Windows

Views

391

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

correct answers 1 Correct answer

Community Expert , Jul 30, 2019 Jul 30, 2019

As the custom calculation script of Field2 enter this:

if (this.getField("Field1").valueAsString=="") {

    event.value = "";

    event.target.display = display.hidden;

} else {

    event.value = "Some text";

    event.target.display = display.visible;

}

Votes

Translate

Translate
Community Expert ,
Jul 30, 2019 Jul 30, 2019

Copy link to clipboard

Copied

As the custom calculation script of Field2 enter this:

if (this.getField("Field1").valueAsString=="") {

    event.value = "";

    event.target.display = display.hidden;

} else {

    event.value = "Some text";

    event.target.display = display.visible;

}

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
Participant ,
Jul 30, 2019 Jul 30, 2019

Copy link to clipboard

Copied

LATEST

That was really a fast response. And, the correct answer. Once again thank you Gilad.

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