How to Use a Drop-Down Value in an Acrobat Form Calculation
Question details
The user needs to map a text selection from a drop-down list to a specific numeric value and use it in a custom PDF form calculation to display a multiplied result.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Creating dynamic PDF forms where a user's drop-down choice dictates a numeric multiplier for other input fields.
- Observed behavior
- The form currently does not automatically multiply the assigned numeric value of the drop-down selection with another input field to output a final result.
Ensure you have Adobe Acrobat Pro or a similar PDF form editor that supports custom JavaScript calculations, and verify the exact names of your drop-down and input fields before writing the script.
Use Custom JavaScript to Calculate Drop-Down Values
The most robust method to map drop-down choices to numeric values and calculate totals is by adding a custom JavaScript calculation script to your final result field.
In Adobe Acrobat, a standard drop-down field returns text. To use this text in a mathematical equation, you must write a brief JavaScript snippet that assigns a numerical value to each text option, performs the multiplication, and outputs the result.
Open your PDF in Acrobat, navigate to the 'Tools' menu, and select 'Prepare Form' to enable form editing.
Right-click the text field where you want the final calculated result to appear and choose 'Properties' from the context menu.
In the Properties dialog box, click on the 'Calculate' tab to view the calculation options for this specific field.
Select 'Custom calculation script' and click the 'Edit' button. Enter a JavaScript code snippet that reads the drop-down value using `this.getField('DropdownName').valueAsString`, maps it to a number using `if/else` statements, multiplies it by the input field, and assigns the total to `event.value`.
Close the properties window. If the math does not update immediately when testing, go to the right-hand panel, click 'More', and select 'Set Field Calculation Order' to ensure the input fields are calculated before the result field.

Create and Edit Interactive PDF Forms with WPS Office
Easily design dynamic PDF forms, insert drop-down lists, and manage form fields with the WPS PDF editor. It provides a lightweight, intuitive, and highly compatible alternative for your PDF document workflows.
- 1. Open Document in WPS PDF: Launch WPS Office and open your PDF document using the built-in PDF editor.
- 2. Navigate to the Form Tools: Click on the 'Form' tab located on the top ribbon to access the interactive form creation tools.
- 3. Insert Form Fields: Select 'Combo Box' to add a drop-down menu, or choose 'Text Field' for user input and calculation areas.
- 4. Configure Field Properties: Double-click the inserted field to open its properties, where you can define item lists, formatting, appearance, and basic actions.

Frequently Asked Questions
Why is my PDF form calculation not updating automatically when I change the drop-down?
This usually happens if the field calculation order is incorrect. In Acrobat's Prepare Form mode, go to the right pane, click 'More', select 'Set Field Calculation Order', and ensure the drop-down and input fields are processed before the final result field.
Can I assign a numerical export value directly to a drop-down item without using code?
Yes. In the drop-down field properties under the 'Options' tab, you can set an 'Item Name' (what the user sees) and an 'Export Value' (the numerical value). A simple multiplication script can then retrieve this export value automatically.
How do I write an 'If-Else' statement in Acrobat JavaScript for drop-downs?
In the custom calculation script window, you can use standard JavaScript syntax. For example: `var choice = this.getField('Dropdown').valueAsString; var multiplier = 0; if (choice == 'Item A') { multiplier = 10; } else if (choice == 'Item B') { multiplier = 20; }` to dynamically assign numbers based on the selected text.




