PDF Editing Issues

How to Use Checkboxes to Show or Hide PDF Form Fields in Acrobat

Muhammad TalhaMuhammad Talha Nov 5, 2026 869 views

Question details

Control the visibility or availability of groups of PDF form fields depending on whether a specific checkbox is selected.

How to Show or Hide PDF Form Fields Using Checkboxes
Product
Adobe Acrobat
Device & OS
not provided
Scenario
Creating an interactive PDF form where different users must complete different sections depending on their choices.
Observed behavior
The user needs a method to dynamically change the display properties (visible, hidden, or read-only) of related form sections when a checkbox is toggled.
Before you start

Ensure you have Adobe Acrobat Pro or an advanced PDF editor installed, as standard PDF readers do not support adding JavaScript actions to form fields.

Solution 1Recommended

Use Acrobat JavaScript on Checkbox Mouse Up Action

Add a JavaScript code to the checkbox's action settings to automatically change the display properties of target form fields when checked or unchecked.

By utilizing the Mouse Up or Validate actions within a checkbox's properties, you can execute a script that detects the checkbox state. Based on this state, you can instruct Acrobat to set other specific fields to be visible, hidden, or read-only.

1
Open Prepare Form Mode

Launch Adobe Acrobat, open your PDF document, and select 'Prepare Form' from the Tools menu.

2
Access Checkbox Properties

Right-click the checkbox you want to act as the trigger, select 'Properties' from the context menu, and click on the 'Actions' tab.

3
Add a JavaScript Action

In the 'Select Trigger' dropdown, choose 'Mouse Up'. In the 'Select Action' dropdown, choose 'Run a JavaScript', and then click the 'Add' button.

4
Enter the Visibility Script

Type the required JavaScript code in the editor. For example: if(event.target.value != 'Off') { this.getField('TargetField').display = display.visible; } else { this.getField('TargetField').display = display.hidden; } Then click 'OK' and close the properties window.

Use Acrobat JavaScript on Checkbox Mouse Up Action
Group Related Fields: Use consistent naming conventions for related form fields. This allows you to hide or show entire sections by referencing a single root field name in your script.
WPS PDF Form Tool

Manage and Edit PDF Forms Seamlessly with WPS Office

While adding complex JavaScript to PDFs requires specialized software, WPS Office provides a robust, lightweight PDF editor that allows you to effortlessly view, fill, and manage interactive PDF forms for your daily document workflows.

  1. 1. Open Your PDF in WPS: Launch WPS Office and open your interactive PDF form document.
  2. 2. Fill the Interactive Fields: Click directly on the checkboxes, text fields, or dropdowns to fill in the required information.
  3. 3. Save the Document: Click the 'Save' icon or press Ctrl+S to preserve your form selections securely.
Easily view and fill out interactive PDF formsHighly compatible with standard PDF formats including Adobe AcrobatLightweight software with fast PDF rendering speedsComprehensive all-in-one suite for PDF, Word, Excel, and PowerPoint
microsoft office alternative - wps office

Frequently Asked Questions

Can I hide PDF form fields without using JavaScript?

You can manually set a field's default property to 'Hidden' in the field's properties panel. However, to dynamically show or hide fields based on user interaction (like clicking a checkbox), Acrobat JavaScript is required.

What is the difference between display.hidden and display.readOnly?

The 'display.hidden' property completely removes the field from the user's view and it cannot be interacted with. The 'display.readOnly' property keeps the field visible on the page, but the user cannot alter its contents.

Will this checkbox JavaScript work in web browser PDF viewers?

Most built-in web browser PDF viewers (like Chrome or Edge) have very limited support for Acrobat JavaScript. For the dynamic form fields to work correctly, users should open the form in a dedicated desktop PDF application.