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

Resetting form after pressing the E-Mail button

CindyF
Registered: Oct 18 2010
Posts: 2

Hello, I am new to Livecycle Designer 8.0. I have created a form that my staff basically enter hospital, date, and marks fields with a check mark and then presses the submit E-Mail key. I have the form set to read only when pressing the email button so that the information is not editable to the recipient(s). My issue is the staff now have to close the PDF and state "NO" to save. I would like to have them to click on an EXIT button that will close the form without saving. Can someone help me with this? I would appreciate any help.
 

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
This is an action that can be accomplished with JavaScript

Method #1:
This method adds a special Exit button to the form.

Add a button, and on the button put this code into the Click Event:

event.target.closeDoc(true);

*******************************
Method #2:
This method tells Acrobat to ignore changes on the PDF so that closing the form does not display the Save Warning when the user clicks on the standard close button. But only after they click on the email button.

On your email button place this script on the MouseUp event

event.target.dirty = false;

*****************************

For both methods make sure to set the script type to JavaScript.

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

CindyF
Registered: Oct 18 2010
Posts: 2
Tomp, thank you for the information, I tried to put the code mentioned above and it does not close the form. Please see an excerpt of my script. Do I need to change anything or add something. Again, thanks for your help.Quit<?templateDesigner StyleID apbx2?>event.target.closeDoc(true);
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The most important bit for writing scripts in a LiveCycle form is to make sure the script type is set to JavaScript, and that the script is placed in the correct location. This is a one liner so there is not much that can go wrong. Have you checked the console window to see if there are any reported errors?


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