How to Restrict Drop-Down Values Based on Selection in Acrobat PDF Forms
Question details
The user needs to prevent specific choices in a secondary drop-down field (DP2) based on the option selected in a primary drop-down field (DP1) within a PDF form.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Creating an interactive PDF form with interdependent drop-down fields, where the options available in the second field change or validate according to the first field's selection.
- Observed behavior
- Currently, users can select unrelated or invalid entries in the second drop-down field. Individual items within the drop-down cannot be directly grayed out or made read-only.
Ensure you have the 'Prepare Form' tool enabled in your PDF editor and possess basic familiarity with adding custom JavaScript actions to form fields.
Dynamically Change the Available Items in the Secondary Drop-Down
Use a custom keystroke or formatting script on the primary drop-down to completely replace the list of options in the secondary drop-down, ensuring users only see valid choices.
Because PDF forms do not support making individual drop-down items read-only or grayed out, the most user-friendly approach is to dynamically populate the second drop-down (DP2) based on the first (DP1).
Enter the form editing mode, right-click your primary drop-down field (DP1), and select 'Properties'.
Navigate to the 'Format' tab, select 'Custom' from the Select Format Category menu, and click 'Edit' to enter your JavaScript.
Enter a script that clears and sets new items for DP2 based on the selection. For example: if (event.value == 'A') { this.getField('DP2').setItems(['E', 'F']); } else if (event.value == 'B') { this.getField('DP2').setItems(['G', 'H']); }
Close the properties dialog, exit form editing mode, and test the first drop-down to ensure the second drop-down's list updates accordingly.

Force a Specific Value Using a Calculation Script
Automatically force the secondary drop-down to a specific value whenever a particular condition in the primary drop-down is met.
Reject Invalid Entries via Validation Script
Allow all items to appear in the secondary drop-down but throw an error and reject the selection if it does not match the primary drop-down's rule.
Easily Create and Edit PDF Forms with WPS PDF
If you are looking for an intuitive way to build interactive forms, add drop-down lists, and manage PDF documents without a steep learning curve, WPS Office offers a comprehensive and lightweight PDF editing experience.
- 1. Open Your PDF: Launch WPS Office, open the PDF editing module, and load your target document.
- 2. Navigate to Form Tools: Click on the 'Form' tab in the top navigation ribbon to reveal all interactive field options.
- 3. Add a Drop-Down List: Select the 'Drop-down List' icon and click anywhere on the page to insert the field.
- 4. Configure Properties: Double-click the newly added drop-down field to add list items, customize appearance, and define behaviors.

Frequently Asked Questions
Can I gray out a single item in a PDF drop-down list?
No, standard PDF specifications do not allow individual list items to be made read-only or grayed out. You must either dynamically remove the item from the list using JavaScript or use a validation script to reject it if selected.
How do I clear the second drop-down field when the first one changes?
You can add a custom keystroke script to the first drop-down field that sets the value of the second drop-down to a blank space or null whenever the first field's value changes.
Will these dynamic drop-down JavaScripts work on mobile PDF viewers?
JavaScript support varies heavily among mobile PDF viewers. While it works flawlessly on fully-featured desktop applications like Adobe Acrobat or WPS PDF, basic mobile viewers may not trigger calculation or formatting scripts correctly.




