How to Show or Lock PDF Form Fields Based on a Checkbox
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.

- 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.
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.
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.
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.
Right-click the primary checkbox, select Properties, and navigate to the Actions tab.
Choose 'Mouse Up' from the Select Trigger dropdown menu, and select 'Run a JavaScript' from the Select Action dropdown, then click Add.
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.
Save the document and interact with the checkboxes in a desktop PDF viewer to ensure the fields correctly lock or hide as intended.
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. Open your PDF: Launch WPS Office and open your fillable PDF document.
- 2. Navigate to the Form tab: Click on the Form tab on the top ribbon to access interactive form tools.
- 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. Adjust properties: Modify visibility, read-only status, and field names, then save the document to apply your changes.

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.




