How to Automatically Populate a Pricing Field from a Dropdown in Acrobat PDF
Question details
The user needs to configure a PDF form so that selecting a specific product from a dropdown menu automatically outputs the corresponding price into a separate text field.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Creating an interactive PDF order form or invoice where pricing dynamically updates based on the user's selected dropdown choice.
- Observed behavior
- The pricing field currently requires manual data entry, but the goal state is to have it automatically fetch and display the value tied to the chosen dropdown item.
Ensure your PDF form already contains both the Dropdown list field for products and the destination Text field for the price before setting up the calculation logic.
Set Export Values and Add a Custom Calculation Script
This method maps dropdown items to their respective prices using export values, and then uses a script to pull that value into the pricing field.
By assigning a specific export value (the price) to each dropdown item, the PDF can retrieve this number automatically. For identical prices across different products, you must use textually unique values to ensure the dropdown functions correctly (for example, use '36' for one item, '36.0' for another, and '36.00' for a third).
Open your PDF form in Adobe Acrobat's 'Prepare Form' tool. Double-click the Dropdown field (e.g., named 'Products') to open its Properties. Navigate to the 'Options' tab, add your items, and assign the 'Export Value' for each item to its corresponding price.
Double-click the destination text field where you want the price to appear (e.g., named 'Pricing') to open its Properties, and go to the 'Calculate' tab.
Select 'Custom calculation script' and click 'Edit'. Enter the following JavaScript: event.value = this.getField("Products").value; (Ensure the field name in quotes matches your actual dropdown name exactly), then click 'OK'.

Create and Edit Interactive PDF Forms with WPS Office
WPS PDF provides comprehensive form creation tools, allowing you to easily add interactive elements like dropdowns, calculation fields, and text boxes to your documents with ease.
- 1. Open WPS PDF: Launch WPS Office and open your PDF document using the built-in WPS PDF tool.
- 2. Navigate to the Form Tools: Click on the 'Form' tab located on the top ribbon to access the interactive field options.
- 3. Add Form Fields: Select 'Combo Box' to insert a dropdown menu, or select 'Text Field' to add an area for your pricing details.
- 4. Configure Properties: Right-click the newly added fields and select 'Properties' to set up your dropdown list items and export values.

Frequently Asked Questions
Why is the wrong price appearing when I select an item from the dropdown?
This usually happens if multiple dropdown items have the exact same export value. Make sure identical prices use textually different formats in the Export Value field, such as '36', '36.0', and '36.00'.
Why is the calculation script not working at all?
Check for typos in the field name within your script. JavaScript is case-sensitive, so getField("products") will fail if the actual field name is "Products". Also, ensure the calculate setting is applied to the destination pricing field, not the dropdown field itself.
Can I use Simplified Field Notation instead of custom JavaScript?
Yes. In the 'Calculate' tab of the pricing field, you can choose 'Simplified field notation' and simply type the name of the dropdown field. However, this works best when your field names do not contain spaces or special characters.




