How to Return a PDF Drop-Down Display Value Instead of Export Value
Question details
The user needs to display the visible text of a PDF form drop-down selection in another field, rather than retrieving its designated calculation or export value.

- Product
- PDF Forms
- Device & OS
- not provided
- Scenario
- Creating or editing interactive PDF forms where a drop-down menu uses separate export values for calculations, but the exact visible text needs to be mirrored or logged elsewhere.
- Observed behavior
- Referencing the drop-down field natively returns the hidden export value, preventing the target field from showing the human-readable text the user selected.
Before applying custom JavaScript to your PDF form, ensure you are using a professional PDF editor with form scripting capabilities and note the exact field name of your drop-down menu.
Use a Custom Calculation Script with currentValueIndices
Extract the visible item text by capturing the index of the selected option in the drop-down menu and passing it to the target field.
This method involves adding a custom calculation script to the target field where you want the text to appear. By referencing the array index of the drop-down selection, the script retrieves the visible label rather than the underlying export data.
Open your PDF in an advanced PDF editor like Adobe Acrobat and enter Form Editing or Prepare Form mode.
Right-click the text field where you want the display value to appear and select 'Properties'.
Navigate to the 'Calculate' tab, select the 'Custom calculation script' option, and click the 'Edit' button.
Input the following code: var f = this.getField("Dropdown1"); var i = f.currentValueIndices; event.value = f.getItemAt(i, false);
Replace 'Dropdown1' with the exact name of your drop-down field, click 'OK' to save, and test the form by selecting an item from the drop-down menu.

Utilize the Drop-Down's Validation Event
Capture the display value immediately upon user selection by utilizing the drop-down's own validation property before the export value commits.
Create and Manage PDF Forms Easily with WPS Office
WPS Office offers a comprehensive suite of PDF tools that make it easy to create interactive forms, configure drop-down menus, and manage field properties. It simplifies standard document tasks without requiring complex scripting.
- 1. Download and open WPS Office: Install WPS Office for free and open your PDF document within the application.
- 2. Access interactive form tools: Navigate to the 'Form' tab on the top ribbon to view available form creation and editing tools.
- 3. Edit drop-down fields: Select 'Drop-Down List' to insert a new field, or double-click an existing one to configure its options and export values.
- 4. Save and distribute: Save your optimized PDF form so it is ready for smooth data collection and user interaction.

Frequently Asked Questions
Why does my PDF drop-down return a number instead of text?
This happens when the drop-down field is configured with a hidden 'export value' (often a number used for background calculations or data processing). Standard field references will return this export value rather than the human-readable text.
What is the difference between an export value and a display value in PDF forms?
The display value is the visible text a user sees and selects in the drop-down menu. The export value is the hidden data tied to that choice, commonly used to pass specific database codes or assign numeric values for mathematical calculations within the form.
Will this JavaScript work in all PDF readers?
Professional PDF editors and standardized readers like Adobe Acrobat and WPS PDF will process these form scripts correctly. However, basic browser-based PDF viewers or simple mobile readers may not fully support advanced JavaScript calculations, which could prevent the script from running.




