How to Enable a Dependent Checkbox Based on Selection in PDF Forms
Question details
The user needs a dependent checkbox (like Car Pool) to become editable only when a specific option (like Regular Access) is selected in another checkbox group.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Creating interactive PDF forms with conditional logic for user inputs.
- Observed behavior
- A specific checkbox needs to dynamically switch between a read-only state and an editable state based on the user's selection in a different checkbox field.
Ensure you have your PDF form open in an editor that supports form field JavaScript, such as Adobe Acrobat Pro, and verify the exact names of your checkbox fields before applying scripts.
Use JavaScript to Control Checkbox Read-Only Status
Add a custom JavaScript action to the controlling checkbox group so that it dynamically updates the dependent checkbox's properties.
To make a checkbox dependent on another selection, you must apply a conditional script to the primary checkbox. This script checks the value of the clicked option and toggles the read-only property of the target checkbox accordingly.
Right-click the primary checkbox (e.g., 'Type of Parking') in Form Editing mode and select 'Properties'.
Navigate to the 'Actions' tab. Select 'Mouse Up' as the trigger, choose 'Run a JavaScript' as the action, and click 'Add'.
Input the following script: `if (event.target.value == "Regular Access") { this.getField("Car Pool").readonly = false; } else { this.getField("Car Pool").value = "Off"; this.getField("Car Pool").readonly = true; }` and click OK.
Repeat this process for every checkbox option within the 'Type of Parking' group so the dependent field updates accurately regardless of what the user clicks.
Open the properties of the dependent checkbox (e.g., 'Car Pool'), go to the 'Actions' tab, and completely remove any existing scripts to prevent conflicts.

Easily Edit and Fill PDF Forms with WPS Office
WPS Office provides powerful PDF editing features, allowing you to easily fill out interactive forms, add checkboxes, and manage your documents without needing expensive software.
- 1. Open the PDF File: Launch WPS Office and open your target PDF form.
- 2. Access Form Tools: Navigate to the 'Form' or 'Fill & Sign' tab on the top ribbon.
- 3. Fill or Modify: Click on the interactive fields to input your data, or use the toolbar to insert new text fields and checkboxes.
- 4. Save Changes: Save the modified PDF document to retain your selections and structural changes securely.

Frequently Asked Questions
Why is my dependent checkbox not unlocking when I make a selection?
This usually happens if the field names in your JavaScript do not perfectly match the actual form field names. Double-check your spelling, capitalization, and spacing for both the controlling and dependent fields.
Can I hide the dependent checkbox instead of making it read-only?
Yes, you can modify the script to change the field's display property. Use `this.getField("Car Pool").display = display.hidden;` to hide it, and change it to `display.visible` to show it when the condition is met.
Do I need to add the script to every checkbox in the group?
Yes, to ensure the dependent field updates correctly whenever the user clicks any option in the controlling group, the JavaScript must be applied to the 'Mouse Up' action of every individual checkbox within that group.




