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

Nov 24, 2017

Copy link to clipboard

Copied

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?

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

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.

TOPICS
Acrobat SDK and JavaScript, Windows

Views

79

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

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

Nov 24, 2017

Copy link to clipboard

Copied

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?

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

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.

TOPICS
Acrobat SDK and JavaScript, Windows

Views

80

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Nov 24, 2017 0
Most Valuable Participant ,
Nov 24, 2017

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 24, 2017 0
Nov 24, 2017

Copy link to clipboard

Copied

Thank you for the instructions.  They worked!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 24, 2017 0