PDF Editing Issues

How to Assign Multiple Export Values to a PDF Dropdown (Calculate Fields)

Tauseeq MagsiTauseeq Magsi Nov 24, 2026 868 views

Question details

The user needs to map multiple unique values to a single dropdown selection in a PDF form and calculate two distinct fields based on that single selection.

How to Assign Multiple Export Values to a PDF Dropdown and Calculate Fields
Product
PDF Forms
Device & OS
not provided
Scenario
Creating a dynamic PDF form where a single dropdown choice (e.g., a specific product) populates multiple related numeric fields (e.g., retail price and discounted price).
Observed behavior
Standard PDF form dropdowns (Combo Boxes) natively allow only one export value per item, making it difficult to automatically populate multiple destination fields without custom scripting.
Before you start

Ensure you have access to a PDF editor with form-building capabilities and custom JavaScript support, and gather all the paired values you intend to assign to your dropdown list.

Solution 1Recommended

Use a Delimiter and Custom Calculation Script

Combine multiple values using a delimiter (like a semicolon) in the export value field, and then split them using a Custom Calculation Script in your target fields.

Since native PDF features limit dropdown items to a single export value, you can encode multiple data points into one string. By using a delimiter, you can extract and route the exact data to different fields using JavaScript.

1
Add a delimiter to the export value

In your dropdown field properties, go to the Options tab. When adding a new item, set the Export Value with a delimiter, for example, '100;95.80' (where 100 is the regular price and 95.80 is the discounted price).

2
Open target field properties

Right-click your first target form field (e.g., Retail Price) and select Properties.

3
Add the custom calculation script

Go to the Calculate tab, select 'Custom calculation script', and enter the following code: var parts = this.getField('DropdownName').valueAsString.split(';'); event.value = Number(parts[0]);

4
Repeat for the second target field

Open the Properties for your second target field (e.g., Discounted Price). Navigate to the Calculate tab, select 'Custom calculation script', and enter the same code but change the index to parts[1], like this: event.value = Number(parts[1]);

Use a Delimiter and Custom Calculation Script
Script adjustments: Ensure that 'DropdownName' perfectly matches the actual field name of your PDF dropdown list. Capitalization matters.
Edit PDF Forms with WPS PDF

Easily Create and Manage Interactive PDF Forms in WPS Office

WPS Office features a robust built-in PDF editor that supports interactive form fields, dropdown lists, and advanced calculations, allowing you to create professional, dynamic documents with ease.

  1. 1. Open your PDF: Launch WPS Office and open your PDF document, then navigate to the 'Form' tab.
  2. 2. Insert a Combo Box: Use the 'Combo Box' tool to add your dropdown list and configure the item names and export values in the Properties panel.
  3. 3. Add target Text Fields: Insert Text Fields where you want the calculated or extracted values to appear.
  4. 4. Apply Calculations: Access the 'Calculate' tab within the Text Field properties to input your custom JavaScript for splitting the export values.
Supports standard PDF interactive forms, dropdowns, and custom calculation logic.Fully compatible with Adobe Acrobat PDF form formats and JavaScript formatting.Lightweight and user-friendly interface for faster document creation.Cross-platform support ensures seamless document management across devices.
microsoft office alternative - wps office

Frequently Asked Questions

Why do standard PDF editors only allow one export value per dropdown item?

Standard PDF specifications tie a single export value to each combo box or list box item to simplify standard data extraction and form submission. To extract multiple distinct variables from a single choice, custom JavaScript is required to parse the data.

What is a delimiter in a custom calculation script?

A delimiter is a specific character (like a semicolon, comma, or pipe) used to separate multiple pieces of data within a single text string. The script uses the split() function to break the string into separate values wherever the delimiter appears.

Do these custom PDF calculation scripts work on mobile PDF viewers?

Most basic PDF viewers on mobile devices do not fully support JavaScript calculations or advanced form behaviors. For forms relying on custom scripts to function correctly, users should open the file in fully-featured desktop applications like WPS Office or Adobe Acrobat.

Can I use text strings instead of numbers with the delimiter method?

Yes. If you want to populate text fields instead of calculating numbers, simply omit the Number() conversion in your custom script and assign the split string parts directly to the target fields (e.g., event.value = parts[0];).