These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Reset Function

Rach1741
Registered: Jun 3 2009
Posts: 26
Answered

Hello all,

I want to make it so my "Print" button and my "Save" button have a 2nd funcation attached that resets the form after either of the functions are completed. Is that possible? When I add another action under mouse up it saves a blank for or print a blank for because it resets too early.

If that won't work can I make it so when you close out of the document it automatically resets?

My goal is to let the user fill out the form and print it or save it to their desktop but make it so when they are done filling out the inital form it will reset so private info isn't up on their screen.

Thanks!

My Product Information:
Acrobat Standard 9.1.1, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
PDF docs have a "DidSave" and a "DidPrint" event. You clould put the reset code here. Look in the
"Advanced > Document Processing > Set Document Actions..." menu itemThom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

Rach1741
Registered: Jun 3 2009
Posts: 26
Thanks for your suggestion. I am new at writing script. What tweaks do I need to make to this to get it to work for reset after save?

save = function(){
document.forms['formname'].reset()
}
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
Are you getting any JavaScript console errors?

If so, please post the entire error text.

It appears you are trying to use Web JavaScirpt, but Acrobat and LiveCycle Designer only use the EMCA standard JavaScript along with the Acrobat JavaScript extensions.

George Kaiser

Rach1741
Registered: Jun 3 2009
Posts: 26
After reading more I think I have figured out that I need to use this script. What do I enter in the "dothis()" portion to reset the whole document.

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Mr. Kaiseril is correct. Acrobat event processing is a bit different from browser scripting. To start off, try this. Enter this code into the DidSave script.

this.resetForm();

Use the menu item shown in my first post

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

Rach1741
Registered: Jun 3 2009
Posts: 26
when I entered this it reset the form after I saved but the saved copy is blank and did not hold the entered text....
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Ahh, did you place the script in the "DidSave" event? WillSave happens before the save and DidSave happens after the save. I did a test on Acrobat 8 Pro, no problems.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

Rach1741
Registered: Jun 3 2009
Posts: 26
THANK YOU SO SO SO SO MUCH!!! It worked :)

I have one more problem I am trying to solve for this work project. I am about to post it. If you could take a look and offer any advice that would be awesome!

Thanks again!