Expand my Community achievements bar.

Email form using JavaScript

Avatar

Level 7
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
2 Replies

Avatar

Level 2
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

Avatar

Former Community Member
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