PDF Editing Issues

How to Get a PDF Dropdown Display Value Instead of Export Value

Huma Ashraf ChHuma Ashraf Ch Nov 5, 2026 869 views

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.

How to Get a PDF Dropdown Display Value Instead of Export Value
Product
PDF
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).
Before you start

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.

Solution 1Recommended

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.

1
Open Field Properties

Open your PDF form in editing mode. Right-click the target text field where you want the display value to appear and select 'Properties'.

2
Navigate to the Script Editor

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.

3
Enter the JavaScript Code

Type the following script into the editor: var f = this.getField("Dropdown3"); var i = f.currentValueIndices; event.value = f.getItemAt(i, false);

4
Save and Test

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.

Use Custom JavaScript to Retrieve the Dropdown Display Value
Understanding the Script: The 'false' parameter in the getItemAt(i, false) method is crucial. It instructs the script to return the face value (the visible label) of the item at that index, rather than the export value.
Advanced PDF Form Management

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. 1. Open PDF in WPS Office: Launch WPS Office and open the PDF document you want to edit.
  2. 2. Access Form Tools: Navigate to the 'Form' tab on the top ribbon to reveal interactive form creation tools.
  3. 3. Insert Form Fields: Select the Dropdown or Text Field icon and click on the page to place the field.
  4. 4. Edit Field Properties: Double-click the inserted field to open its properties, where you can define export values, display labels, and custom actions.
Fully compatible with standard PDF form fields and interactive elements.Intuitive interface for adding dropdowns, text fields, checkboxes, and buttons.Lightweight all-in-one suite to view, edit, and convert PDFs without heavy software.Seamlessly retain form formatting and compatibility with Adobe Acrobat.
microsoft office alternative - wps office

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.