Skip to main content
Known Participant
August 29, 2024
Answered

Help with Dropdown list selections that populate text fields

  • August 29, 2024
  • 1 reply
  • 576 views

Hello! I am very new to Javascript and would like to know  in Acrobat Pro if it is possible based on the selection in a drop down field, that another text field will populate specific text.

 

I am grateful for your assistance.

 

Thank you!

This topic has been closed for replies.
Correct answer PDF Automation Station

There are 2 ways to do this:

1)  A custom validation script in the dropdown.  In this case, the user can change the text in the text field that is populate.

2) A custom calculation script in the text field.  In this case, the user can't change the text in the text field because it will always revert to the calculated value based on the dropdown selection.

#1 example:

if(event.value=="ABC"){this.getField("TheTextField").value=="The text to populate"}

#2 example:

if(this.getField("TheDropdownField").value=="ABC"){event.value="The text to populate"}

1 reply

PDF Automation Station
Community Expert
Community Expert
August 29, 2024

There are 2 ways to do this:

1)  A custom validation script in the dropdown.  In this case, the user can change the text in the text field that is populate.

2) A custom calculation script in the text field.  In this case, the user can't change the text in the text field because it will always revert to the calculated value based on the dropdown selection.

#1 example:

if(event.value=="ABC"){this.getField("TheTextField").value=="The text to populate"}

#2 example:

if(this.getField("TheDropdownField").value=="ABC"){event.value="The text to populate"}

Known Participant
September 11, 2024

My apologies for the delay responding. Example #2 worked perfectly. Thank you so very much!!