Skip to main content
Participant
November 24, 2017
Answered

I require some help writing a javascript for a pdf form with a dropdown menu

  • November 24, 2017
  • 1 reply
  • 623 views

I require some help writing a javascript for a pdf form.  I have a dropdown menu listing all 12 of our Committees.  What I would like to do is when someone selects one of the committees from the dropdown menu a code assigned to a specific committee will automatically appear in another text box.

Example:

they select "Executive Committee" from the dropdown box

the code for Executive Committee is "561"

the code 561 will automatically appear in a separate textbox 

Could someone provide me with step by step instructions and the javascript I should use?

This topic has been closed for replies.
Correct answer try67

All you have to do is set the code as the "Export Value" for each item in your field and then use this simple custom calculation script in the text field where you want to display it:

event.value = this.getField("Committee").valueAsString;

Make sure to tick the option to immediately commit the selected value of the drop-down field for it to work the moment a selection is made.

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
November 24, 2017

All you have to do is set the code as the "Export Value" for each item in your field and then use this simple custom calculation script in the text field where you want to display it:

event.value = this.getField("Committee").valueAsString;

Make sure to tick the option to immediately commit the selected value of the drop-down field for it to work the moment a selection is made.

Participant
November 24, 2017

Thank you for the instructions.  They worked!