PDF Editing Issues

Run PDF JavaScript Immediately After a Drop-Down Selection in Adobe Acrobat

Ayan MasoodAyan Masood Nov 25, 2026 869 views

Question details

Run a PDF form script as soon as a user selects an item in the first drop-down so that a second drop-down updates immediately.

Run PDF JavaScript Immediately After a Drop-Down Selection in Adobe Acrobat
Product
PDF form JavaScript; Adobe Acrobat form editor
Device & OS
not provided
Scenario
A PDF form has dependent drop-down fields, and the second field's choices depend on the first field's selection.
Observed behavior
The second drop-down does not update until focus leaves the first field.
Before you start

Open the PDF in a form editor that supports field validation scripts, such as Adobe Acrobat Pro. Check the exact field names and the display and export values of the first drop-down's items.

Solution 1Recommended

Use a Validate script and commit the drop-down value immediately

Use this approach when a dependent field updates only after the user leaves the first drop-down.

The Validate action runs when the selected value is committed. Enabling immediate commitment triggers the action as soon as the user makes a selection.

In the validation script, use event.value for the value being committed. Make sure the values compared in the script match the configured choices; if using display text, keep the corresponding export values identical.

1
Open the form field

In Adobe Acrobat Pro, open the PDF and choose All tools > Prepare a form. Double-click the first drop-down field to open its properties.

2
Enable immediate commitment

On the Options tab, select Commit selected value immediately.

3
Add the validation script

On the Validate tab, select Run custom validation script and click Edit. Move the existing update script there, or enter a script that checks event.value and calls setItems() on the second field. Replace field names and choice values with those from your form.

4
Test the selections

Close the properties, preview the form, and select each item in the first drop-down. Confirm that the second drop-down updates without clicking outside the first field, then save the PDF.

Use a Validate script and commit the drop-down value immediately
Check PDF JavaScript support: The viewer used to fill out the form must support PDF JavaScript and have it enabled. Some browser PDF viewers may not run the script.
Free Microsoft Office alternative

Work with PDFs and Office files in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with PDFs and Microsoft Office files. It makes moving between common document formats easy, but it does not replace Acrobat's PDF form JavaScript configuration for this fix.

Open and review PDF documents alongside your other filesCompatible with Microsoft Office formats including DOCX, XLSX, and PPTXUse a familiar interface for a smoother move from Microsoft OfficeAccess document, spreadsheet, and presentation tools in one lightweight suite
microsoft office alternative - wps office

Frequently Asked Questions

Why does the second drop-down update only after I click elsewhere?

The first field's value may not be committed until it loses focus. In its Properties > Options tab, select Commit selected value immediately and place the update script in the Validate action.

Which value should the validation script check?

Use event.value to read the value being committed. Check the first drop-down's item settings and ensure the values in your script match its configured display and export values.

Can multiple selections produce the same list in the second field?

Yes. In the first field's Validate script, group those cases or point them to the same item list before calling setItems() on the second field.

Why does the script work in Acrobat but not in a browser?

Some browser PDF viewers do not support PDF form JavaScript. Test the saved form in Acrobat or Acrobat Reader, and check Preferences > JavaScript to confirm that Acrobat JavaScript is enabled.