Skip to main content
Participant
August 3, 2018
Answered

How can I make form field invisible until another form field is completed?

  • August 3, 2018
  • 2 replies
  • 2440 views

How can I make form field invisible until another form field is completed?

For example, you cannot fill in a comment section until you answer yes or no above.

This topic has been closed for replies.
Correct answer Lukas Engqvist

If your forms are done in InDesign you can do it from there by "hide until triggered" on the form you want hidden. And when you click a button you can use the action show/hide form. It requires less programming but the JavaScript method is possible to define even more solidly.

You can also do this in Acrobat by using the Show/hide action

2 replies

Lukas Engqvist
Community Expert
Lukas EngqvistCommunity ExpertCorrect answer
Community Expert
August 5, 2018

If your forms are done in InDesign you can do it from there by "hide until triggered" on the form you want hidden. And when you click a button you can use the action show/hide form. It requires less programming but the JavaScript method is possible to define even more solidly.

You can also do this in Acrobat by using the Show/hide action

Thom Parker
Community Expert
Community Expert
August 3, 2018

If the dependency is on a checkbox or radio button, then use this script in the calculation script for the field that will be shown/hidden

Assume the dependency field is named "YesNo".

event.target.hidden = (this.getField("YesNo").valueAsString == "Off");

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often