I want to reset the complete form after opening it.
I have tried this:
page.open = this.resetForm();
But it doesn't work. I'm using Acrobat Pro DC.
How to reset a form when opening:
You can follow these instructions (note that the description is for Acrobat DC; in older versions, it is similar).
Open your document in Acrobat.
Display the Pages in the Left Hand Panel.
Select the Context menu of the first page (or the page which has been specified in the document properties to open).
Select Page Properties… from the context menu
In the dialog which appears, select the Actions tab
Select Trigger Page Open
Select Action Run a JavaScript
Click Add
In the editor window which appears enter the following code:
If your form is a single page document:
this.resetForm() ;
If your form is a multiple page document:
if (loaded == false) {
this.resetForm() ;
loaded = true ;
}
If you have a multi-page document, proceed as follows:
Switch to the Tools window, and select the JavaScript Tool
Select Document JavaScripts in the toolbar
In the dialog which opens enter a name for your script, such as loading
Click Add…
In the editor window which opens, delete all the selected text.
Then enter this line of code:
var loaded = false ;
Confirm until you are back to the document.
Save the document
And that should do it.