How to Get a PDF Dropdown Display Value Instead of Export Value
Question details
The user needs to retrieve and display the visible text label of a selected PDF dropdown item in a combined text field, rather than its numerical export value.

- Product
- Device & OS
- not provided
- Scenario
- Creating an interactive PDF form where a target text field must reflect the human-readable label chosen in a dropdown menu.
- Observed behavior
- By default, referencing the dropdown field returns its hidden export value (e.g., 1, 2, 3) instead of the visible label (e.g., red, blue, green).
Ensure your PDF form editor supports JavaScript for interactive form fields. You will need to access the properties of the target text field to add a custom calculation or validation script.
Use Custom JavaScript to Retrieve the Dropdown Display Value
Apply a custom script using the currentValueIndices property and getItemAt() method to fetch the display label instead of the export value.
In interactive PDF forms, dropdown fields often have an 'Export Value' used for data processing and a 'Display Value' (the text the user actually sees). When you simply assign the dropdown's value to another field, it pulls the export value. To get the visible text, you must use a JavaScript snippet to find the index of the selected item and retrieve its text label.
Open your PDF form in editing mode. Right-click the target text field where you want the display value to appear and select 'Properties'.
Go to the 'Calculate' or 'Validate' tab (depending on when you want the script to trigger). Select the option to run a custom JavaScript and open the JavaScript editor.
Type the following script into the editor: var f = this.getField("Dropdown3"); var i = f.currentValueIndices; event.value = f.getItemAt(i, false);
Click 'OK' to save the script and close the properties window. Switch to form filling mode, select an item in the dropdown, and verify that the target text field updates with the visible label.

Create and Edit Interactive PDF Forms with WPS Office
WPS Office provides a comprehensive PDF editor that allows you to design interactive forms, manage dropdown lists, and configure text field properties with ease.
- 1. Open PDF in WPS Office: Launch WPS Office and open the PDF document you want to edit.
- 2. Access Form Tools: Navigate to the 'Form' tab on the top ribbon to reveal interactive form creation tools.
- 3. Insert Form Fields: Select the Dropdown or Text Field icon and click on the page to place the field.
- 4. Edit Field Properties: Double-click the inserted field to open its properties, where you can define export values, display labels, and custom actions.

Frequently Asked Questions
Why does my PDF dropdown return a number instead of the text?
When a dropdown field is configured with distinct export values (often used for backend data processing, databases, or scoring), referencing the field's value directly will automatically return that hidden export value. You must use JavaScript to bypass the export value and explicitly call the visible display label.
Can I get the display value without using JavaScript?
No. If the dropdown has distinct export values defined in its properties, the default calculation behavior in standard PDF readers will always pass the export value. Using a short JavaScript snippet is the only way to access the visible item array.
What if my dropdown allows multiple selections?
If the dropdown permits multiple selections, the currentValueIndices property will return an array of indices rather than a single number. You would need to write a JavaScript loop to iterate through this array and retrieve the display value for each selected item.




