logo
search
PDF Editing Issues

How to Show or Lock PDF Form Fields Based on a Checkbox

Jason MillerJason Miller Oct 23, 2026 869 views

Question details

The user needs to configure a fillable PDF form so that selecting a specific checkbox automatically hides, disables, or requires other mutually exclusive follow-up fields.

How to Show or Lock PDF Form Fields Based on a Checkbox
Product
PDF Editor
Device & OS
not provided
Scenario
Designing a dynamic HR or business form with mutually exclusive options, where selecting one choice must control the visibility and required status of subsequent fields.
Observed behavior
Form fields need to automatically update their properties (becoming read-only, hidden, or required) immediately after a user interacts with a designated checkbox.
Before you start

Verify that your PDF editing software supports JavaScript and advanced form field properties. Ensure every checkbox and target text field in your document has a clear, unique name before configuring interactive logic.

Solution 1Recommended

Use Checkbox Actions to Control Field Properties

Configure a Mouse Up action with JavaScript on your checkboxes to dynamically alter the read-only or hidden status of related form fields.

By applying custom scripts to a checkbox's Mouse Up trigger, you can dictate exactly how other fields behave when the box is checked or unchecked. This ensures users only fill out information relevant to their selection.

1
Assign unique field names

Open your form in prepare mode and ensure that each checkbox and its corresponding follow-up text fields have unique, identifiable names in their properties.

2
Access checkbox actions

Right-click the primary checkbox, select Properties, and navigate to the Actions tab.

3
Set the action trigger

Choose 'Mouse Up' from the Select Trigger dropdown menu, and select 'Run a JavaScript' from the Select Action dropdown, then click Add.

4
Apply logic script

Input a script that targets the opposing option's fields, setting them to hidden (display.hidden) or read-only (readonly = true) when the current box is checked.

5
Test the form behavior

Save the document and interact with the checkboxes in a desktop PDF viewer to ensure the fields correctly lock or hide as intended.

Testing Environment: Always test dynamic JavaScript forms in a dedicated desktop PDF application like Adobe Acrobat or WPS Office, as many web browser PDF viewers limit or block JavaScript execution.
Easily Create Dynamic PDF Forms

Create and Manage Interactive PDF Forms with WPS Office

WPS Office provides a complete suite of PDF editing tools, allowing you to easily insert checkboxes, text fields, and configure interactive form properties without hassle.

  1. 1. Open your PDF: Launch WPS Office and open your fillable PDF document.
  2. 2. Navigate to the Form tab: Click on the Form tab on the top ribbon to access interactive form tools.
  3. 3. Insert or Edit fields: Select Checkbox or Text Field to insert new elements, or double-click existing fields to open their Properties panel.
  4. 4. Adjust properties: Modify visibility, read-only status, and field names, then save the document to apply your changes.
Easily add interactive checkboxes, text fields, and dropdowns to your PDF forms.Fully compatible with standard PDF forms and Adobe Acrobat formatting.Edit, merge, sign, and fill PDF documents all in one lightweight application.
microsoft office alternative - wps office

Frequently Asked Questions

Why aren't my conditionally locked PDF form fields updating when I click the checkbox?

This usually happens if you are testing the form in a web browser's built-in PDF viewer. Many browser viewers do not fully support PDF JavaScript. Always test dynamic forms in a dedicated desktop PDF editor.

Can I make a PDF field required only if a specific checkbox is selected?

Yes. You can use a custom validation script on the checkbox to change the 'required' property of the target field dynamically when the checkbox state changes.

How do I group checkboxes so only one can be selected at a time?

To make checkboxes mutually exclusive, similar to radio buttons, give them the exact same Field Name but assign them different Export Values in their properties.