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

Explorer ,
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, Macintosh, Windows

Views

125

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

correct answers 1 Correct Answer

Adobe Community Professional , 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;}

Likes

Translate

Translate
Adobe Community Professional ,
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;

}

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
Explorer ,
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.

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