Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Export Value from Drop Down Menu

Explorer ,
May 19, 2017 May 19, 2017

Untitled.png

in above picture there is a drop down menu with 5 menu items and a text field

what is need is:

when "Item 1" is selected then textbox1.text = "name 1"

when "Item 2" is selected then textbox1.text = "name 2"

when "Item 3" is selected then textbox1.text = "name 3"

when "Item 4" is selected then textbox1.text = "name 4"

when "Item 5" is selected then textbox1.text = "name 5"

i want to control the textbox text from drop down menu item.

I need javascript for this.

Thanks.

TOPICS
Acrobat SDK and JavaScript , Windows
1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 20, 2017 May 20, 2017
LATEST

There are a number of ways to accomplish this.

The simplest is to create the dropdown box and then enter the values for the "Item" and the "Export Value" for that item. I would make sure the "Commit the selected value immediately" is checked. Then Select the "Format" tab and select the "Custom" option for the format. In the "Custom key stroke" enter the following script:

if(event.willCommit == false)

{

this.getField("Text1").value = event.changeEx;

}

"Text1" is assumed to be the name of the text field you want to place the selected item's export value into.

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