How to Display Dropdown Export Value Instead of Item Text in PDF
Question details
The user needs a PDF dropdown menu to display the underlying export value (such as an abbreviation) instead of the full item label after a selection is made.

- Product
- Device & OS
- not provided
- Scenario
- Creating or editing interactive PDF forms where dropdown lists contain long descriptions but need to display short codes or abbreviations once selected.
- Observed behavior
- By default, the PDF form dropdown displays the user-facing item label upon selection, rather than the separate export value assigned to that item.
Ensure you have a PDF editor with advanced form creation capabilities that supports custom JavaScript formatting, such as Adobe Acrobat Pro or WPS Office.
Use a Custom Format Script in the Dropdown Properties
Apply a JavaScript snippet within the dropdown's Format tab to override the default displayed text with your specified export value.
When setting up dropdowns, the item name is what the user sees in the list, and the export value is the underlying data. To force the field to show the export value (e.g., 'TX') instead of the label (e.g., 'Texas') after clicking, you must use a custom formatting script.
Open your PDF document in form editing mode. Right-click the target dropdown field and select 'Properties' from the context menu.
In the Dropdown Properties dialog box, click on the 'Format' tab at the top. Do not use the Actions or Calculate tabs for this process.
Click the 'Select format category' dropdown menu and choose 'Custom' from the list of options.
In the 'Custom Format Script' text box, enter the following code exactly: event.value = event.target.getItemAt(event.target.currentValueIndices, true);
Click 'Close' to save the properties. Exit form editing mode and test the dropdown by selecting an item to ensure the export value is successfully displayed.

Create and Manage Interactive PDF Forms with WPS Office
WPS Office offers a comprehensive built-in PDF editor that allows you to seamlessly create, edit, and fill interactive PDF forms, including custom dropdowns and text fields.
- 1. Open your PDF: Launch WPS Office and open the PDF document where you want to add or modify form fields.
- 2. Access Form Tools: Navigate to the 'Form' tab on the top ribbon to access the interactive form creation tools.
- 3. Add a Dropdown Field: Click on the 'Combo Box' (Dropdown) icon and draw the field onto your PDF page.
- 4. Configure Properties: Double-click the new dropdown field to open its properties, where you can define item labels and their corresponding export values.
- 5. Save the Document: Save your PDF to lock in the interactive form fields for users to fill out.

Frequently Asked Questions
Why isn't my custom format script working when placed in the Actions tab?
The provided script specifically modifies the display formatting of the field. If placed in the Actions or Calculate tabs, the script will not trigger correctly upon a user's selection. You must always place it in the Custom Format Script section under the Format tab.
Can I use this method to display state abbreviations automatically?
Yes. Set up your dropdown items with the full state name as the 'Item' (e.g., 'Texas') and the abbreviation as the 'Export Value' (e.g., 'TX'). Adding the provided JavaScript to the Format tab will ensure 'TX' is displayed when 'Texas' is selected.
Will displaying the export value affect how the form data is submitted?
No. Modifying the displayed value via a format script only changes what the user visually sees on the document screen. The actual underlying export value remains intact and will be submitted correctly when the form data is extracted.




