How to Show Specific Dropdown Options When a Checkbox is Selected in Acrobat PDF
Question details
The user needs a way to dynamically filter and display specific choices in a dropdown menu only when a particular checkbox is checked within a PDF form.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Creating an interactive PDF form where dropdown list selections need to dynamically adjust based on user interaction with a checkbox (e.g., selecting specific tax rates when a checkbox is toggled).
- Observed behavior
- Currently, the dropdown displays all items simultaneously, rather than filtering and restricting the options dynamically based on the checkbox's state.
Ensure you have access to a PDF editing tool that supports custom form field JavaScript authoring, and take note of the exact field names for both your checkbox and your dropdown menu.
Use JavaScript setItems() on the Checkbox Event
Apply custom JavaScript to the checkbox's Mouse Up event to dynamically redefine the items in the target dropdown field.
To achieve dynamic form behavior in Acrobat, you can bind a JavaScript action to the checkbox field. By listening to the event triggered when the checkbox state changes, you can use the setItems() method to replace the array of options currently loaded in the dropdown field.
Open your PDF document and launch the 'Prepare Form' tool to access form field properties.
Right-click the target checkbox field and select 'Properties' from the context menu.
Navigate to the 'Actions' tab. Select 'Mouse Up' as the Trigger, choose 'Run a JavaScript' as the Action, and click 'Add'.
In the editor, define your logic using the setItems() method. For example: var dropdown = this.getField("TaxRates"); if (event.target.value !== "Off") { dropdown.setItems([["Rate 1","rate1"],["Rate 2","rate2"]]); } else { dropdown.setItems([["Select a rate",""],["Rate 1","rate1"],["Rate 2","rate2"],["Rate 3","rate3"]]); }.
Click 'OK' to save the script, close the properties dialog, and exit the form editing mode to test the checkbox behavior.

A Powerful and Lightweight Alternative for Everyday PDF Needs
While advanced JavaScript form creation is typically handled by specialized tools like Adobe Acrobat Pro, WPS Office is an excellent, free alternative for filling interactive forms, editing PDFs, and managing all your office documents in one place.
- 1. Download and Install WPS Office: Visit the official WPS website, download the free version, and follow the standard installation prompts.
- 2. Open Your PDF Form: Launch WPS Office and click on 'Open' to select your PDF form document.
- 3. Fill and Save: Click directly on the interactive form fields to fill out your data, then save the document securely to your local drive or cloud.

Frequently Asked Questions
Why doesn't my dropdown update when I click the checkbox?
This usually happens if the JavaScript is applied to the wrong event or if the field names in the code do not perfectly match the names of the form fields. Ensure you attached the script to the 'Mouse Up' event and check for case sensitivity.
What does the setItems() method do in Acrobat JavaScript?
The setItems() method is used to programmatically replace the entire list of selectable options in a combo box or list box by passing an array containing the new display texts and their corresponding export values.
Can I use this JavaScript for multiple checkboxes controlling the same dropdown?
Yes, but you will need to add more complex conditional logic (like nested if/else statements) in your JavaScript to check the combined states of all relevant checkboxes before calling the setItems() method.




