PDF Editing Issues

How to Enable a Dependent Checkbox Based on Selection in PDF Forms

John WilsonJohn Wilson Nov 5, 2026 868 views

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.

How to Enable a Dependent Checkbox Based on Selection in PDF Forms
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.
Before you start

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.

Solution 1Recommended

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.

1
Open Properties of the Controlling Checkbox

Right-click the primary checkbox (e.g., 'Type of Parking') in Form Editing mode and select 'Properties'.

2
Add a Custom Action Script

Navigate to the 'Actions' tab. Select 'Mouse Up' as the trigger, choose 'Run a JavaScript' as the action, and click 'Add'.

3
Enter the Conditional Logic

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.

4
Apply to All Relevant Checkboxes

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.

5
Clean Up Dependent Field Scripts

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.

Use JavaScript to Control Checkbox Read-Only Status
Field Names Matter: Make sure the field names in the JavaScript exactly match the names of your form fields (e.g., 'Regular Access' and 'Car Pool'), as they are strictly case-sensitive.

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. 1. Open the PDF File: Launch WPS Office and open your target PDF form.
  2. 2. Access Form Tools: Navigate to the 'Form' or 'Fill & Sign' tab on the top ribbon.
  3. 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. 4. Save Changes: Save the modified PDF document to retain your selections and structural changes securely.
Seamlessly fill and edit interactive PDF formsAdd text, checkboxes, and signatures to any PDFFully compatible with standard Adobe PDF formatsLightweight application with an intuitive, familiar interface
microsoft office alternative - wps office

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.