PDF Editing Issues

How to Hide PDF Form Fields When Radio Buttons Are Unchecked

Anum MushtaqAnum Mushtaq Nov 5, 2026 869 views

Question details

The user needs to ensure that specific PDF form fields are successfully hidden when radio buttons are unselected or when the form is fully reset.

Product
PDF
Device & OS
not provided
Scenario
Developing or troubleshooting an interactive PDF form where field visibility is controlled by the selection state of radio buttons.
Observed behavior
Fields fail to remain hidden after a form reset because the reset state registers the radio button value as 'Off' instead of an empty string, and the reset action does not automatically trigger the visibility scripts.
Before you start

Ensure your PDF editor supports JavaScript for interactive forms, and save a backup copy of your document before editing the form scripts.

Solution 1Recommended

Implement a Custom JavaScript Reset Button

Use a custom JavaScript button to explicitly reset the form and hide the target fields instead of relying on the default form reset action.

A standard PDF reset action simply restores fields to their default values. It does not automatically run the JavaScript calculations or visibility scripts attached to your radio buttons. To force the fields to hide, you must combine the reset command with explicit display commands.

1
Create a new button

Open your PDF editor's form preparation tool and insert a new Button field to act as your custom 'Reset' button.

2
Access button actions

Right-click the new button, select 'Properties', and navigate to the 'Actions' tab.

3
Select JavaScript action

From the 'Select Action' dropdown menu, choose 'Run a JavaScript' and click 'Add'.

4
Insert the custom script

Enter the script to reset the form and hide the fields. For example: `this.resetForm(); this.getField("STEP").display = display.hidden; this.getField("START_DEICE").display = display.hidden;`. Add similar lines for any remaining fields, then click 'OK'.

Implement a Custom JavaScript Reset Button
Easy PDF Form Management

Manage Interactive PDF Forms with WPS Office

WPS Office provides robust PDF editing tools, making it easy to open, edit, and interact with fillable PDF forms seamlessly on your device.

  1. 1. Open your PDF: Launch WPS Office and open your interactive PDF document.
  2. 2. Access form tools: Navigate to the 'Form' tab to view and interact with fillable fields and checkboxes.
  3. 3. Edit and save: Fill in the required fields or modify form elements, then save your document securely.
Effortlessly handle interactive PDF forms and form fieldsPerfect compatibility with Microsoft Office and standard PDF formatsFree and lightweight alternative to heavy PDF editorsCross-platform support for Windows, Mac, and mobile
microsoft office alternative - wps office

Frequently Asked Questions

Why doesn't the default reset button hide my conditionally visible fields?

The default form reset action in PDF specifications merely reverts fields to their initial states. It does not trigger the JavaScript validation or calculation scripts attached to fields like radio buttons, so any logic meant to hide fields won't execute.

What is the default unchecked value of a PDF radio button?

In standard PDF form specifications, an unselected or reset radio button usually returns the string value 'Off' rather than an empty string ("") or a null value.

Can I hide multiple fields at once in PDF JavaScript?

Yes. You can sequentially target each field and set its display property to hidden by writing a script like: `this.getField("Field1").display = display.hidden; this.getField("Field2").display = display.hidden;`.