How to Conditionally Show Form Fields Based on Radio Buttons in Acrobat
Question details
The user needs to make four additional form fields visible and enabled only when a specific radio button option is selected.

- Product
- Adobe Acrobat Pro DC
- Device & OS
- not provided
- Scenario
- Creating an interactive PDF form where certain options dynamically reveal additional data entry fields.
- Observed behavior
- Additional form fields must be hidden or read-only by default and dynamically become visible and enabled when a specific radio button option is triggered.
Ensure you are using Adobe Acrobat Pro DC and have the 'Prepare Form' tool enabled. Verify the exact names of the target text fields you wish to show or hide before writing the script.
Use JavaScript Actions to Control Field Visibility
Configure the radio button properties to execute a custom JavaScript snippet that changes the display properties of your target fields when clicked.
In Adobe Acrobat, dynamic field visibility is handled by assigning a JavaScript action to the trigger event (like clicking a radio button). When the user selects the designated radio button, the script updates the visibility and read-only properties of the linked fields.
Open your PDF in Adobe Acrobat Pro DC, click on 'Tools' in the top menu, and select 'Prepare Form'.
Locate the specific radio button that should trigger the change. Right-click it and select 'Properties'.
Navigate to the 'Actions' tab. Set 'Select Trigger' to 'Mouse Up'. Set 'Select Action' to 'Run a JavaScript', then click the 'Add' button.
In the JavaScript Editor, enter the code to show the fields (e.g., this.getField("TargetField1").display = display.visible;) and click 'OK' to save.
Repeat the process for the other radio buttons in the group, replacing display.visible with display.hidden in the script to ensure the fields disappear when the user selects a different option.

Discover WPS Office for Seamless Document and PDF Management
While advanced JavaScript actions in PDF forms require specialized Adobe software, WPS Office provides an incredibly lightweight, free, and comprehensive alternative for everyday office tasks. It easily handles standard document editing, spreadsheet calculations, presentation design, and standard PDF viewing and annotating without a steep learning curve.
- 1. Download WPS Office: Visit the official WPS Office website to download the free installation package for your operating system.
- 2. Install the Suite: Run the downloaded installer and follow the on-screen prompts to complete the setup process in minutes.
- 3. Open and Edit Files: Launch WPS Office to easily open, edit, and manage your PDFs, Word documents, Excel sheets, and PowerPoint presentations in a single tabbed window.

Frequently Asked Questions
Can I show and hide form fields in Acrobat without using JavaScript?
No, Adobe Acrobat relies on custom JavaScript actions to dynamically change field properties like visibility or read-only status based on real-time user input.
Why are my conditionally hidden fields not appearing when I select the radio button?
This usually occurs if the field names in your JavaScript code do not perfectly match the actual names of the form fields, or if there is a typo in your script syntax.
How do I make the additional form fields hidden by default when the PDF is first opened?
In the 'Prepare Form' tool, right-click the fields you want hidden, select 'Properties', go to the 'General' tab, and change the 'Form Field' dropdown from 'Visible' to 'Hidden'.




