How to Automatically Check a PDF Checkbox When a Dropdown Value is Selected
Question details
The user wants to configure a PDF form so that selecting a specific option in a dropdown menu automatically checks a corresponding checkbox.

- Product
- Device & OS
- not provided
- Scenario
- Creating or configuring interactive PDF forms with conditional field logic.
- Observed behavior
- The user needs to implement a script or setting that connects the dropdown selection event to the checkbox state.
Ensure you are using a PDF editor that supports interactive form creation and JavaScript validation, and identify the exact field names of both your dropdown and checkbox before applying the script.
Add a Custom JavaScript Validation Script to the Dropdown
Use a simple JavaScript snippet within the dropdown field's properties to automatically update the checkbox state based on the selected value.
In interactive PDF forms, you can use Acrobat JavaScript to create conditional logic between fields. By placing a custom validation script inside the dropdown menu, the PDF will listen for user selections and dynamically change the value of the target checkbox.
Enter the form editing mode in your PDF editor, right-click the target dropdown field, and select 'Properties' from the context menu.
In the Properties dialog box, click on the 'Validate' tab (or the 'Format' / 'Calculate' tab, depending on your PDF software version) and select the option to 'Run custom validation script'.
Click 'Edit' and paste the following code: if (event.value === "name") { this.getField("checkbox1").value = "Yes"; } (Replace 'name' with your target dropdown option and 'checkbox1' with the actual name of your checkbox field).
Click 'OK' to save the script, close the properties window, and exit form editing mode. Select your specified option in the dropdown to verify that the checkbox is checked automatically.

Easily Manage Interactive PDF Forms with WPS Office
WPS Office includes a comprehensive, built-in PDF editor that allows you to easily view, fill out, and manage interactive PDF forms alongside your daily document tasks.
- 1. Open WPS Office: Launch WPS Office and navigate to the 'PDF' tab on the home screen.
- 2. Load Your PDF Form: Click 'Open' to select and load your interactive PDF document into the editor.
- 3. Fill and Manage Forms: Interact directly with form fields, dropdowns, and checkboxes. WPS PDF will process built-in form logic natively.
- 4. Save and Export: Once your form is filled, click 'Save' to preserve your selections securely while maintaining standard PDF compatibility.

Frequently Asked Questions
Why isn't the checkbox updating when I change the dropdown selection?
This typically occurs if the field names referenced in your JavaScript do not exactly match the field names in your PDF form. It can also happen if the export value for the checkbox is set to something other than 'Yes'. Double-check your field properties to ensure accurate spelling and capitalization.
How can I automatically uncheck the checkbox if a different dropdown value is chosen?
You can add an 'else' condition to your JavaScript code. For example: if (event.value === "name") { this.getField("checkbox1").value = "Yes"; } else { this.getField("checkbox1").value = "Off"; }.
Does JavaScript form validation work in all PDF viewers?
Custom JavaScript validation works reliably in most major desktop PDF editors like Adobe Acrobat and WPS Office. However, some basic mobile PDF viewers or web browser PDF extensions may not fully support interactive form scripts.




