How to Hide PDF Form Fields When Radio Buttons Are Unchecked
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
- 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.
Ensure your PDF editor supports JavaScript for interactive forms, and save a backup copy of your document before editing the form scripts.
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.
Open your PDF editor's form preparation tool and insert a new Button field to act as your custom 'Reset' button.
Right-click the new button, select 'Properties', and navigate to the 'Actions' tab.
From the 'Select Action' dropdown menu, choose 'Run a JavaScript' and click 'Add'.
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'.

Update the Radio Button Validation Logic
Modify your existing radio button script to check for the correct unchecked value, which is generally 'Off' rather than an empty string.
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. Open your PDF: Launch WPS Office and open your interactive PDF document.
- 2. Access form tools: Navigate to the 'Form' tab to view and interact with fillable fields and checkboxes.
- 3. Edit and save: Fill in the required fields or modify form elements, then save your document securely.

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;`.




