Skip to main content
Participant
October 25, 2023
Question

If then in PDF form

  • October 25, 2023
  • 2 replies
  • 457 views

I am trying to make an if then statement where if one item is selected in a drop down box it auto populates a text box with pre defined text, but if the other option is selected it's a blank textbox.

 

What's the best way to do this?

This topic has been closed for replies.

2 replies

try67
Community Expert
Community Expert
October 26, 2023

Should the text in the text field be the same as the selected item in the drop-down, or something else?

Should the user be able to enter something into the text field, if one of the other options is selected in the drop-down?

Thom Parker
Community Expert
Community Expert
October 26, 2023

Make the predefined text the export value of each item in the dropdown. Then use a Custom keystroke script to fill the text box. Like this:

 

if(!event.willCommit) this.getField("TextField").value = event.changeEx;

 

 

 

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