PDF Editing Issues

Add Export Values to Acrobat PDF Dropdown Items with JavaScript

Anum MushtaqAnum Mushtaq Nov 19, 2026 869 views

Question details

The user wants to populate an Acrobat PDF dropdown with displayed labels and separate export values using JavaScript.

Add Export Values to Acrobat PDF Dropdown Items with JavaScript
Product
Adobe Acrobat
Device & OS
not provided
Scenario
A PDF form dropdown needs to show readable item labels while storing corresponding export values.
Observed behavior
Each dropdown item should display its label and use its paired value when the form data is exported.
Before you start

Open the PDF in Acrobat and use Prepare a form to check that the dropdown field exists and note its exact field name. The example below uses a dropdown named Month and a button to run the script.

Solution 1Recommended

Set Dropdown Labels and Export Values with Acrobat JavaScript

Use a two-dimensional array with setItems when each visible dropdown label needs a different export value.

1
Open form editing

In Acrobat, open the PDF and select All tools > Prepare a form. Select the dropdown and check its field name in Properties.

2
Add a button action

In Prepare a form, add or select a button. Open its Properties, choose the Actions tab, select Mouse Up as the trigger and Run a JavaScript as the action, then click Add.

3
Enter the script

In the JavaScript editor, enter: this.getField("Month").setItems([["January", "01"], ["February", "02"], ["March", "03"]]); Replace Month with the exact name of your dropdown field, then save the action.

4
Test the dropdown

Close form editing, click the button to run the script, and open the dropdown. Select an item and check the exported form data to verify its value.

Set Dropdown Labels and Export Values with Acrobat JavaScript
Label and value order: In each pair, the first string is the visible label and the second is the export value. For example, January is displayed while 01 is its export value.
Free Microsoft Office alternative

Work with PDFs and Office Files in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with PDFs and Office documents. Its format compatibility makes it easier to move existing files into your workflow. Use Acrobat for the specific JavaScript form action described above.

Open and work with PDF documents alongside Office filesCompatible with Microsoft Office formats, including DOCX, XLSX, and PPTXFamiliar interface for an easier transition from Microsoft OfficeFree and lightweight suite for everyday document work
microsoft office alternative - wps office

Frequently Asked Questions

How do I give a dropdown item a different export value?

Pass setItems an array of pairs, such as [["January", "01"]]. The first string is the displayed label; the second is the export value.

Where do I find the dropdown field name?

In Acrobat, open All tools > Prepare a form, select the dropdown, and open its Properties. Use the exact field name in this.getField().

Where can I add the JavaScript in Acrobat?

One option is a button action: in Prepare a form, open the button's Properties, select Actions, and add a Run a JavaScript action for the Mouse Up trigger.

Does setItems add to the existing dropdown list?

No. setItems replaces the dropdown's current items with the items in the supplied array. Include every item you want in the resulting list.