Skip to main content
Known Participant
July 30, 2019
Answered

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

  • July 30, 2019
  • 1 reply
  • 757 views

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.

This topic has been closed for replies.
Correct answer try67

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;

}

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
July 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;

}

pdfUser1Author
Known Participant
July 30, 2019

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