How to Reset PDF Form Fields Automatically When Opening
Question details
The user wants to configure a PDF form to automatically clear all existing entries and restore default field values every time the document is opened.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Distributing a reusable PDF form where the creator wants to guarantee that the fields are entirely blank upon each new open, regardless of previous inputs.
- Observed behavior
- By default, a saved PDF form retains previously entered data when reopened. The user wants to override this behavior to force an automatic reset state.
Before applying automatic reset scripts to your PDF, ensure you have a backup copy of the original form. Keep in mind that automatically clearing data can severely frustrate users who expect their partial progress to be saved.
Add Document-Level JavaScript in Acrobat Pro
Use a simple JavaScript command to force the form to reset all fields immediately upon opening.
You can achieve this by adding a document-level JavaScript code in Adobe Acrobat Pro. While this method successfully clears the form upon opening, use it with extreme caution. It will irreversibly delete any data a user might have saved if they attempt to reopen the file to continue working.
Open your PDF file in Adobe Acrobat Pro. Navigate to the top menu, click on 'Tools', select 'JavaScript', and then choose 'Document JavaScripts'.
In the Document JavaScripts dialog box, type a recognizable name for your script (such as 'AutoReset') into the Script Name field, then click the 'Add' button.
Delete any default function code that appears in the editor window. Replace it by typing exactly: this.resetForm();
Click 'OK' to save the script and close the dialog. Save your PDF document, close it, and then reopen it to verify that all form fields are automatically cleared.

Edit and Fill PDF Forms Safely with WPS Office
Instead of forcing potentially frustrating automatic document resets, use WPS PDF to fill, manage, and interact with PDF form fields safely. WPS Office offers a comprehensive, user-friendly suite for all your daily document needs.
- 1. Open the PDF: Download and install WPS Office, then open your interactive PDF form using the WPS PDF application.
- 2. Fill the Form Fields: Navigate to the fields within the document. WPS PDF automatically highlights fillable text boxes, checkboxes, and drop-down menus for easy data entry.
- 3. Clear Data Manually: To clear data safely without risking automatic data loss, simply use the 'Reset' button if provided on the document by the author, or manually clear fields using your keyboard.
- 4. Save Your Progress: Click 'File' > 'Save' to securely save your partial or completed form locally or to WPS Cloud, guaranteeing your data is retained for your next session.

Frequently Asked Questions
Why shouldn't I use an automatic reset script on my PDF forms?
Automatic reset scripts trigger every single time the document is opened. This means if a user partially fills out the form, saves it to their desktop, and opens it later to finish, all their entered data will be permanently erased. This often leads to a poor and frustrating user experience.
Can I reset only specific fields instead of the entire form?
Yes. In the JavaScript code, you can pass an array of specific field names to the reset function. For example, using this.resetForm(['NameField', 'DateField']); will clear only those specific fields when the document opens, leaving the rest of the form data intact.
Is there a safer alternative to automatic document-level resets?
A much safer alternative is to add a dedicated 'Reset Form' button directly onto the PDF page using the 'Prepare Form' tools. This allows users to manually clear the form fields only when they intentionally click the button, preventing accidental data loss.




