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

Dropdown list: Select Item, but display Export Value

Community Beginner ,
May 06, 2020 May 06, 2020

Copy link to clipboard

Copied

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

Views

1.5K

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
community guidelines

correct answers 2 Correct answers

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?page=1

 

Votes

Translate

Translate
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. 

Votes

Translate

Translate
Community Expert ,
May 06, 2020 May 06, 2020

Copy link to clipboard

Copied

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...

 

Votes

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

Copy link to clipboard

Copied

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

 

 

Votes

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

Copy link to clipboard

Copied

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

Votes

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

Copy link to clipboard

Copied

thank you both, this worked!

Votes

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

Copy link to clipboard

Copied

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?

Votes

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

Copy link to clipboard

Copied

LATEST

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

 

 

exportvalue-custom-combobox.png

Votes

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
community guidelines