How can i use javascript and formula language in a same button

I have a form and it contains the email field.I am doiung the validateion in javascript and after that i want to use a @function(@mailsend) in a same button .How can i achieve this ?Is it possible to do it?Does anyone has any idea?

thanks in advance

paula j

Subject: How can i use javascript and formula language in a same button

What you can do is put a button on the form where your Forumla code will go to do the mail send. Open the Button Properties and on the HTML Table put a name in for the button like SaveMe.

Put the following code around the button:

button

Note: in the above code you need to remove the words quote and put in actual quotes

Next highlight the above code and select Text, Pass-Thru HTML.

Now all you need to do is have your javascript code click the button once validation passes.

document.forms[0].SaveMe.click();

I use this all the time in my applications.

Subject: RE: How can i use javascript and formula language in a same button

Hi thanks for u r suggestion.But i a problem.I have followed all the steps that u suggest.But where should i place the code document.forms[0].SaveMe.click().I don’t know where i have to plcae it?I have the function validate() in my JSHeader.I have the button .I have written the @mailsend in the button click but where can i call the validate funciton.Does i missed anything

I have the button and i have given the button name and placed the within the div tag also

Subject: RE: How can i use javascript and formula language in a same button

Call the validate() function from the onsubmit. Formula actions need to submit the document to the server in order to be processed, and the onsubmit is called before the submit() method is called in the _doClick() function.