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

Dropdown list: Select Item, but display Export Value

Community Beginner ,
May 06, 2020 May 06, 2020

Hi all, 

I'm trying to generate a dropdown menu, "Dropdown1," and have the selected displayed Item generate the Export Value instead of the Item itself. What would be the javascript and do I add this within the Actions or Calculate tab?

General-->Name: "Dropdown1"

Options-->
Item: Instructor Led Training
Export Value: ILT

Item: Computer Based Training
Export Value: CBT

Thanks in advance, 

TOPICS
Create PDFs , Edit and convert PDFs , PDF forms
2.1K
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
2 ACCEPTED SOLUTIONS
Community Expert ,
May 06, 2020 May 06, 2020

Hi, 

 

This has been answered before.

 

Use this line of code:

 

event.value = event.target.getItemAt(event.target.currentValueIndices, true);

 

Answered by George_Johnson back in 2016: https://community.adobe.com/t5/acrobat/display-export-value-of-dropdown-instead-of-item/td-p/7936974...

 

View solution in original post

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
Community Expert ,
May 06, 2020 May 06, 2020

No, it cannot be done from the Actions or Calculate tab. It can only be done from a custom Format event. Using the code that ls_rbls posted. 

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

View solution in original post

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
Community Expert ,
May 06, 2020 May 06, 2020

Hi, 

 

This has been answered before.

 

Use this line of code:

 

event.value = event.target.getItemAt(event.target.currentValueIndices, true);

 

Answered by George_Johnson back in 2016: https://community.adobe.com/t5/acrobat/display-export-value-of-dropdown-instead-of-item/td-p/7936974...

 

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
New Here ,
Jun 09, 2020 Jun 09, 2020

I am new to all of this.

 

Do I have to enter any specific words in the line of code?

event.value = event.target.getItemAt(event.target.currentValueIndices, true);

 

General - Employee

 

Item - Name 1

Export - 2121

 

Item - Name 2

Export - 3131

 

 

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
Community Expert ,
May 06, 2020 May 06, 2020

No, it cannot be done from the Actions or Calculate tab. It can only be done from a custom Format event. Using the code that ls_rbls posted. 

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

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
Community Beginner ,
May 06, 2020 May 06, 2020

thank you both, this worked!

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
New Here ,
Aug 06, 2020 Aug 06, 2020

I've tried this code but it doesn't seem to be working for me. Unless I'm not understanding the post and replies correctly. Let's say I have a list of the 50 states spelled out in the Items List, and when I select "Texas" I would like for it to show "TX" in the same list box.

 

Does the code mentioned here work for this?

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
Community Expert ,
Aug 06, 2020 Aug 06, 2020
LATEST

Place the script in the custom format script section. See slide:

 

 

exportvalue-custom-combobox.pngexpand image

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