PDF Editing Issues

Retrieve a Drop-Down List Item Value in Acrobat JavaScript

Jason MillerJason Miller Nov 19, 2026 869 views

Question details

Retrieve the newly selected display and export values from an Acrobat PDF form drop-down using JavaScript.

How to Retrieve a Drop-Down List Item Value in Acrobat JavaScript
Product
Adobe Acrobat
Device & OS
not provided
Scenario
A form author is writing a Keystroke script for a PDF drop-down field.
Observed behavior
During the Keystroke event, currentValueIndices and getItemAt can still refer to the previously committed selection.
Before you start

Open the PDF in Acrobat and locate the drop-down field in Prepare a form. Check the field's Options to identify its item labels and export values.

Solution 1Recommended

Read the New Selection From the Keystroke Event

Use event properties to capture the incoming selection before it is committed.

When event.willCommit is false, event.change provides the incoming display value and event.changeEx provides its export value. The field's currentValueIndices and getItemAt may still reflect the previous committed selection.

1
Open the field properties

In Acrobat, open Prepare a form, then double-click the drop-down field to open its properties.

2
Open the Keystroke script editor

On the Format tab, choose Custom from the format category list, then select Edit next to Custom Keystroke Script.

3
Add the event code

Enter: if (!event.willCommit) { console.println("Change=" + event.change + " Export=" + event.changeEx); }

4
Test a selection

Close the properties, open Acrobat's JavaScript console, and select an item in the drop-down. Check the console for the incoming display and export values.

Read the New Selection From the Keystroke Event
CSV export is separate: Reading a selection does not create a CSV file. A CSV export requires additional scripting; creating a CSV as a PDF attachment generally requires Acrobat Pro, and Reader has restrictions.
Free Microsoft Office alternative

Work With PDF Documents in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with PDFs and Microsoft Office files. Its format compatibility makes it easy to move everyday documents into WPS. Acrobat-specific JavaScript behavior still needs to be tested in Acrobat.

Open and review PDF documents alongside other office files.Compatible with Microsoft Word, Excel, and PowerPoint formats.Use a familiar interface to make the transition from Microsoft Office easier.Work with documents in a lightweight office suite available for free.
microsoft office alternative - wps office

Frequently Asked Questions

Why does currentValueIndices show the previous drop-down selection?

During a Keystroke event, the new selection may not yet be committed. When event.willCommit is false, use event.change for the incoming display value and event.changeEx for the incoming export value.

Where do I add a Keystroke script to a drop-down field?

In Acrobat, open Prepare a form and double-click the field. On the Format tab, select the Custom format category and edit the Custom Keystroke Script.

How do I check an item's export value?

Open the drop-down field's properties in Prepare a form and check the item settings on the Options tab. In a Keystroke script, event.changeEx supplies the incoming export value.

Does this script export the selection to CSV?

No. It prints the incoming values to Acrobat's JavaScript console. CSV export is a separate task that requires additional scripting; creating a CSV attachment generally requires Acrobat Pro.