PDF Editing Issues

How to Use Multiple Dropdown Export Values in Acrobat PDF Forms

Algirdas JasaitisAlgirdas Jasaitis Nov 3, 2026 869 views

Question details

Populate two distinct PDF form fields with different approver names based on a single dropdown menu selection.

How to Use Multiple Dropdown Export Values in a PDF Form
Product
Adobe Acrobat PDF
Device & OS
not provided
Scenario
Creating advanced interactive PDF forms where selecting an option from a dropdown needs to dynamically fill multiple related text fields.
Observed behavior
By utilizing a custom delimiter in the export value, a calculation script successfully splits the string and assigns the separate values to their corresponding target text fields.
Before you start

Ensure that your PDF editing software has form editing and JavaScript execution capabilities enabled, and take note of the exact field names you intend to use.

Solution 1Recommended

Use a Delimiter and Custom Calculation Script

Store multiple values within a single dropdown export value separated by a character (like a pipe), then use JavaScript to split and distribute the values.

A dropdown field in a PDF can technically only have one export value. However, this value can be any string. By joining multiple values together with a specific delimiter character, you can use a custom script to split that string back into multiple parts and populate other fields accordingly.

1
Set the Dropdown Export Values

Open the properties of your dropdown field. In the Options tab, set the Export Value for your item to include both names separated by a pipe character (e.g., "Jimmy Buffett|Steve Goodman"). Ensure you include the pipe character for all items, even if there is only one name (e.g., "Single Name|").

2
Add Custom Calculation Script to the First Field

Open the properties for the first target text box. Navigate to the Calculate tab, choose 'Custom calculation script', and click Edit. Paste the following JavaScript: (function () { var sNames = getField("Dropdown1").valueAsString; var aNames = sNames.split("|"); var f2 = getField("Name2"); if (aNames.length === 2) { event.value = aNames[0]; f2.value = aNames[1]; } else { event.value = ""; f2.value = ""; } })();

3
Update the Field Names

In the script you just pasted, change "Dropdown1" to the exact name of your dropdown field, and change "Name2" to the exact name of your second target text box. Click OK and close the properties window to apply the changes.

Use a Delimiter and Custom Calculation Script
Test Your Form: Switch your PDF editor to 'Preview' or 'Hand' mode and select different items from your dropdown to verify that both text fields update automatically.

Create and Manage Interactive Forms with WPS Office

WPS Office includes a robust PDF editor that allows you to effortlessly design, fill, and manage interactive PDF forms without complex setups.

  1. 1. Open your PDF: Launch WPS Office and open your PDF document using the WPS PDF tool.
  2. 2. Access the Form Tab: Navigate to the 'Form' tab on the top ribbon to reveal all interactive form controls.
  3. 3. Add or Edit Fields: Select the dropdown or text field icons to add new elements, or double-click existing fields to modify their properties and options.
  4. 4. Save and Export: Once your form is configured, click 'Save' to preserve the interactive elements for user distribution.
Easily insert text fields, dropdowns, and checkboxes into any PDF document.Highly compatible with standard Adobe Acrobat PDF form formats.Lightweight, fast, and user-friendly interface for seamless document management.Edit PDF text, images, and pages with a few simple clicks.
QA img-9

Frequently Asked Questions

Can I use a character other than a pipe (|) as my delimiter?

Yes, you can use commas, hyphens, tildes, or any other character as a delimiter. Just ensure the character you choose will never naturally appear within the actual names or values, and remember to update the .split("|") function in the script to match your new delimiter.

Why are my target text fields not updating when I make a dropdown selection?

This usually happens if JavaScript is disabled in your PDF viewer or if the field names referenced in the script (like "Dropdown1" and "Name2") do not exactly match the actual names of your form fields. Form field names are case-sensitive.

What happens if one of the dropdown options only has one approver name?

To prevent the script from malfunctioning, you should still include the delimiter in the export value. For example, use "John Doe|". The script will assign 'John Doe' to the first field and leave the second field blank.

Can I extend this script to populate three or more fields?

Absolutely. You can add more delimiters in your export value (e.g., "Name1|Name2|Name3"). In your script, declare a variable for the third field (var f3 = getField("Name3");), change the array length check to 3, and add f3.value = aNames[2]; to the execution block.