Link Two PDF Dropdown Menus with a Calculation Script in Adobe Acrobat
Question details
Automatically select a corresponding value in one PDF dropdown when a month is chosen in another.

- Product
- Adobe Acrobat PDF forms
- Device & OS
- not provided
- Scenario
- A PDF form has a month dropdown and a second dropdown with a corresponding date or value for each month.
- Observed behavior
- Selecting a month should automatically select its matching value in the second dropdown.
Open the form in an Acrobat edition that can edit PDF form fields, and check the names and export values of both dropdowns. Make sure each dropdown has an item for every month and that its export values are unique within that list.
Use matching export values and a calculation script
Use this method when both dropdowns can share a unique export value for each month.
The dropdowns can show different labels while sharing export values. For example, the first may display January and the second a corresponding date, while both items use the export value 01.
This method selects an existing item in the second dropdown; it does not dynamically change the items available in that dropdown.
In Adobe Acrobat, open the PDF and choose All tools > Prepare a form. Select the first dropdown and open its Properties to check its field name; this example uses Month.
In each dropdown's Properties, open the Options tab. Assign matching export values to corresponding items, such as 01 for January through 12 for December. Keep each export value unique within its dropdown.
In the Month dropdown's Properties > Options, select Commit selected value immediately so the form recalculates when the user changes the month.
Open the second dropdown's Properties, select Calculate > Custom calculation script, and click Edit. Enter: event.value = this.getField("Month").valueAsString; Replace Month with the exact name of your first field.
Close the field properties, leave form editing, and select each month in the first dropdown. Confirm that the second dropdown displays the corresponding item, then save the PDF.

Map different dropdown export values with a calculation script
Use an explicit mapping when corresponding items cannot have the same export values.
Test Linked PDF Dropdowns with WPS Office
After adding the calculation script in Acrobat, open the PDF in WPS Office to check whether the linked dropdowns work in your intended viewing environment. Script support can vary by viewer and version, so use Acrobat to author the calculation and verify the result in WPS before distributing the form.
- 1. Create the link: In Acrobat's Prepare a form tool, add the calculation script to the second dropdown and save the PDF.
- 2. Open the PDF: Launch WPS Office, choose Open, and select the saved PDF form.
- 3. Check the dropdowns: Select several months in the first dropdown and check whether the second dropdown changes to the corresponding values.
- 4. Resolve compatibility issues: If the second dropdown does not update in WPS, test the same form in Acrobat or another viewer that supports PDF form JavaScript before sharing it.

Frequently Asked Questions
Why use a calculation script instead of a Mouse Up action?
A calculation script on the second dropdown is designed to update its value when the form recalculates. A Mouse Up action depends on a particular mouse interaction and may not cover every way a selection changes.
Do the dropdown labels have to be identical?
No. The visible labels can differ if corresponding items use the same export value. Set those values in each dropdown's Properties > Options.
Why doesn't the second dropdown update immediately?
In the first dropdown's Properties > Options, select Commit selected value immediately. Also check that PDF JavaScript and form calculations are supported and enabled in the viewer.
Can this script change the available items in the second dropdown?
No. The scripts shown select an existing item. Changing the available list requires a different script and additional testing for viewer support.
What if the form works in Acrobat but not another PDF viewer?
The other viewer may not support the form's JavaScript or calculation features. Test the form in a viewer that supports PDF form JavaScript and tell recipients which viewer to use.




