Highlighted

Email form using JavaScript

Aditya_S_

18-02-2009

I would like to perform certain validations when user clicks the email button. However, I am unable to enter any JavaScript in the click event. This event is disabled.



Is there a way to email a form using JavaScript (not through the Submit tab)? This way I can run the validations in the click event, before emailing the form.



Any other suggestions are welcome.



Thanks

Aditya

Replies

Highlighted

Allta_Media

19-02-2009

Thom Parker has an article on the four different functions you can use to send e-mail from a PDF -- these are AcroForm Javascript functions that also work in LiveCycle form:

http://www.acrobatusers.com/tutorials/dynamically-setting-submit-e-mail-address
Highlighted

Steve_L_Walker

20-02-2009

Aditya,



A common solution is to use two buttons. Add a Email Submit Button object and define the presence as 'invisible'. Let's name the object 'EmailSubmitBtn'. Add a Button object and change the caption to 'Email'. Let's call the object 'EmailBtn'. One the 'EmailBtn' click event perform the required validations and then call the click event on the 'EmailSubmitBtn'. You call the 'EmailSubmitBtn' click event as follows:



form1.subform1.EmailSubmitBtn.execEvent("click");



Steve