Call 2 functions onsubmit for form

Hi,

Urgently need some help here.

I am about to submit a form and I need to call two functions onsubmit. But I guess this cannot be achieve?? :confused:

<form name=“reply” action=“example.php” method=“post” onsubmit=“return submitForm();return Form1_validator(this);”>

[COLOR=Indigo]<?php //update textbox standard reply and customised message?>
<script language=“JavaScript” type=“text/javascript”>
<!–
function submitForm() {

updateRTE('standard_reply');

return true;

}
</script>[/COLOR]

[COLOR=DarkOrange]<?php //Validation for form?>

<script Language=“JavaScript”>
<!–
function Form1_validator(theForm)
{
if (theForm.to_email.value==“”)
{
alert(“Please enter the to field. Thank you.”);
theForm.to_email.focus();
return(false);
}

return(true);
}
</script>[/COLOR]

How do I call both functions onsubmit?

Any advise is moat appreciated!

Thank you so much and have a great day!


<form ... onsubmit="return (submitForm() && Form1_validator(this))">

Both functions are required to return true. Of course you can modify it as much as you want :slight_smile:

Hi Sorccu,

Neat! I have got it. Thanks a million!

Anyway, I have added a “;” at the end of your script.

<form … onsubmit=“return (submitForm() && Form1_validator(this));”>

Have a great day!