How to Hide Acrobat Form Fields After Resetting a PDF
Question details
The user needs to ensure that conditionally hidden PDF form fields return to their hidden state after the form is cleared or reset.

- Product
- Adobe Acrobat / PDF
- Device & OS
- not provided
- Scenario
- Creating or filling an interactive PDF form with conditional fields tied to checkboxes.
- Observed behavior
- Resetting the form clears the field values but fails to reset the display properties, leaving hidden fields visible.
Ensure you have access to the PDF form editing tools and basic knowledge of adding JavaScript actions to buttons within your PDF editor.
Create a Custom Reset Button Using JavaScript
Replace the default reset action with a custom script that clears data and resets field visibility simultaneously.
The standard form reset functionality in PDF editors only clears the input values of the fields. It does not revert any display properties (like visibility) that were triggered by user actions during the session. To resolve this, you must override the default reset button with a custom JavaScript action.
Open your PDF form in edit mode and insert a new Button field where you want the Reset function to be.
Right-click the button, select 'Properties', and navigate to the 'Actions' tab.
Choose 'Mouse Up' as the trigger, set the 'Select Action' dropdown to 'Run a JavaScript', and click 'Add'.
In the JavaScript editor, enter the code to reset the form data: this.resetForm();
On the next line, add the code to hide the specific conditional fields. For example: this.getField("FieldName").display = display.hidden;

Manage and Edit PDF Forms Seamlessly with WPS Office
WPS Office provides robust PDF editing capabilities, allowing you to fill, create, and manage interactive PDF forms effortlessly. Whether you need to process conditional form fields or convert documents, WPS Office has you covered.
- 1. Open PDF: Launch WPS Office and open your interactive PDF document.
- 2. Access Form Tools: Navigate to the 'Form' tab to interact with, fill, or modify form fields easily.
- 3. Save and Export: Save your filled or modified PDF directly, ensuring strict compatibility across all standard PDF viewers.

Frequently Asked Questions
Why doesn't the default Reset Form button hide my fields?
The standard reset action is only designed to clear the values (data) entered into the fields. It does not revert visual or display properties (such as visibility) that were modified by custom JavaScript interactions during the session.
How does hierarchical field naming work in PDFs?
By naming fields with a shared prefix and a dot (e.g., 'Group.1', 'Group.2', 'Group.3'), you create a hierarchy. A single JavaScript command targeting the parent 'Group' will automatically apply the changes to all child fields, making it highly efficient to show or hide multiple fields at once.
Can I reset specific fields instead of clearing the whole form?
Yes. When writing custom JavaScript for your reset button, you can pass an array of specific field names to the reset function (for example: this.resetForm(["Field1", "Field2"]);). This will clear only the specified fields while leaving the rest of the form intact.




