Copy link to clipboard
Copied
I'm trying to create a form that resets if's fields to blank when it is closed.
I'm using the following actions
MouseUp
Execute menu item
After the file is closed I reopen it and find that what was filled in the form still remains and it was not reset to blank.
I have also tried the following Java commands
please help if you can.
Use this code to reset the entire form:
this.resetForm();
Copy link to clipboard
Copied
Why do you want to do that? That is very frustrating for anyone using it...
Copy link to clipboard
Copied
The form in question is an expense submission sheet for our mobile employees to fill in and submit, we don't want information remaining in the form for the next person to see, the form needs to be reset to blank for the next employee to submit there expenses.
As it stands right now when the form is exited out (without saving) and reopened you see the last persons expense information in it.
Copy link to clipboard
Copied
Move the code to a doc-level script, so that it executes when the file is opened, instead.
Copy link to clipboard
Copied
OK I just did a quick search on setting up doc-level scripts for Adobe Acrobat DC and I just want to confirm are you referring to the Action to Run JavaScript's under the button properties?
Copy link to clipboard
Copied
Ok I found what you are talking about now.
Now I have to find some script that will work with the document.
Copy link to clipboard
Copied
Use this code to reset the entire form:
this.resetForm();
Copy link to clipboard
Copied
That worked!
But I'm running into one more issue in the process is there any way to suppress the prompt to save the document when closing so we don't overwrite the existing document or save more than one copy?
Copy link to clipboard
Copied
Yeah, there is. Go to Tools - JavaScript - Set Document Actions and under the "Document Will Close" event enter this code:
this.dirty=false;
Copy link to clipboard
Copied
Thanks
It now closes without asking to save.