How to Reset Only One Page in a Multi-Page PDF Form
Question details
The user wants to create a reset button that clears form fields on a specific page of a multi-page PDF form without having to list dozens of field names manually.

- Product
- PDF Form Editor
- Device & OS
- not provided
- Scenario
- Managing a complex, multi-page PDF form where users need to clear data on the current page without affecting the rest of the document.
- Observed behavior
- The standard reset function clears the entire document, requiring an automated way to target and reset only the fields located on a specific page index.
Ensure your PDF form is fully created and all field names are finalized. You will need access to the JavaScript editor in your PDF application to implement this automated reset function.
Use Document-Level JavaScript to Target Specific Pages
Create a custom JavaScript function that loops through all form fields, identifies which ones belong to the target page, and resets only those fields.
Instead of manually selecting dozens of fields in the button properties, you can use a document-level script. This automated loop checks the page index of every field in the PDF. It gathers the names of fields located on your chosen page into an array and passes that array to the resetForm function.
Open your PDF editor, navigate to the Tools menu, and access the Document-Level JavaScripts section.
Add a new script and define a function, for example, 'function resetPageFields(pageNum)'. Inside this function, create an empty array to store the target field names.
Write a 'for' loop using 'this.numFields' to iterate through all fields. Use 'this.getNthFieldName(i)' to get each field's name.
Inside the loop, retrieve the field object and check its 'page' property. If the property matches your 'pageNum' variable, push the field name into your array.
After the loop finishes, call 'this.resetForm(fieldArray)' to clear only the collected fields.
Add a 'Reset' button to your target page. Under the button's Action properties, choose 'Run a JavaScript' and enter 'resetPageFields(0);' (use the correct page index).

Manage and Edit PDF Forms Easily with WPS Office
WPS Office provides a comprehensive PDF editor that allows you to view, fill, and manage interactive PDF forms effortlessly. Whether you need to reset form fields, add new text, or convert documents, WPS PDF handles it all seamlessly while offering broad format compatibility.
- 1. Download and Install WPS Office: Download WPS Office from the official website and open the WPS PDF application.
- 2. Open Your PDF Form: Click 'Open' to load your multi-page interactive PDF form into the workspace.
- 3. Fill and Manage Fields: Navigate to the Form tab to interact with text fields, checkboxes, and buttons. You can easily clear or fill data as needed.
- 4. Save and Export: Once your form adjustments are complete, click 'Save' or export the document to share it securely.

Frequently Asked Questions
Why does my reset button clear the entire PDF form instead of one page?
By default, the standard 'Reset a form' action clears all interactive fields within the entire document. To restrict the reset action to a single page, you must either specify the exact fields manually in the button properties or use a custom JavaScript function to target a specific page index.
Can I reset specific fields without using JavaScript?
Yes, you can use the standard 'Reset a form' action in the button properties and manually check the boxes next to the specific fields you want to clear. However, this method can be tedious and prone to errors for forms containing dozens of fields.
What happens if a form field spans across multiple pages?
If a field widget appears on multiple pages (meaning the fields share the exact same name), resetting it from any page will clear its value across all pages. The data is tied to the field name, not just the physical location of the widget.




