How to Calculate Contract Prices From Dropdown Values in PDF Forms
Question details
Create a fillable PDF contract that automatically calculates line totals and final prices based on selected dropdown options and user-entered quantities.

- Product
- Device & OS
- not provided
- Scenario
- Designing a professional, automated contract form where clients select items from a dropdown, input quantities, and see automatically calculated totals.
- Observed behavior
- Requires a method to assign hidden numeric values to text dropdowns, multiply them by quantity fields, and sum the results without manual calculation.
Ensure you are using an advanced PDF form editor that supports field properties, export values, and calculation expressions.
Use Built-in Calculation Expressions and Export Values
Assign numeric export values to dropdown options and use built-in product and sum calculations to generate totals.
This method uses the native calculation features of PDF forms without requiring complex programming knowledge. By setting an 'export value', you can display a text description to the user while using a hidden price for the math.
Right-click your dropdown field (e.g., named 'product.1') and open its Properties. Go to the Options tab. Add your items by entering the product name in 'Item' and its price in 'Export Value'. Click Add for each item.
Create a text field for the quantity and name it consistently, such as 'amount.1'. Ensure its format is set to Number in the Format tab to prevent calculation errors.
Create a text field for the line total (e.g., 'lineTotal.1'). Open its Properties, navigate to the Calculate tab, and select 'Value is the [product] of the following fields'. Click 'Pick' and select 'product.1' and 'amount.1'.
Create a final text field named 'GrandTotal'. In its Calculate tab, choose 'Value is the [sum] of the following fields' and select all your 'lineTotal' fields (e.g., lineTotal.1, lineTotal.2).

Apply Custom JavaScript for Complex Form Logic
Use JavaScript for advanced mathematical operations, conditional tax rates, or tiered pricing models.
Design Automated Contracts with WPS Office
While scripting PDF forms can be complex and tedious, WPS Office offers a seamless way to create automated contracts. Use WPS Spreadsheet to effortlessly handle dropdowns and calculations, then export directly to a professional PDF for your clients.
- 1. Design Your Contract in Spreadsheet: Open WPS Spreadsheet and lay out your contract, dedicating columns for Item, Quantity, Price, and Total.
- 2. Add Dropdown Menus: Select the Item cells, go to the Data tab, and click Data Validation. Choose 'List' to create your product dropdowns.
- 3. Apply Auto-Calculating Formulas: In the Total column, enter a simple formula like '=B2*C2' to instantly calculate line totals based on selected items and entered quantities.
- 4. Export to PDF: Once your contract template is ready, click Menu > Export to PDF. This generates a clean, read-only document ready to be sent to clients.

Frequently Asked Questions
Why is my PDF form calculation not updating automatically?
This usually happens due to an incorrect calculation order or if auto-calculation is disabled in the PDF viewer. Check your form editor's settings to ensure line totals are calculated before the grand total.
What is an export value in a PDF dropdown field?
An export value is a hidden, underlying value assigned to a dropdown option. While the form displays a readable text item (like 'Premium Plan') to the user, the form uses the export value (like '199') for background calculations.
Can I use standard Excel formulas in a PDF form?
No, PDF forms do not support Excel syntax like '=A1*B1'. They rely on built-in basic calculation rules (sum, product, average) or custom JavaScript for executing mathematical operations.




