Hi all,
I have one form which has to do two functions on sumbit.
The form looks lik this.
<form method="post" id="searchlist " name="searchlis t" onsubmit="retur n (OnSubmitForm(r esult) && validate())">
And the javascript is:
Now, i want to add another one function validate(). This looks like
function validate(){
.....
.....
}
As soon as i click the submit button it gets submitted and it does not pass through validate() function.
Any Suggestions.
Thanks
Haan
I have one form which has to do two functions on sumbit.
The form looks lik this.
<form method="post" id="searchlist " name="searchlis t" onsubmit="retur n (OnSubmitForm(r esult) && validate())">
And the javascript is:
Code:
function OnSubmitForm(result)
{
if(result == 'Show_Results')
{
document.searchlist.action ="?action=show_results";
}
else if(result == 'Download_CSV')
{
document.searchlist.action ="?action=download_csv";
}
else if(result == 'Email_Results')
{
document.searchlist.action ="?action=email_results";
}
document.searchlist.submit();
}
}
function validate(){
.....
.....
}
As soon as i click the submit button it gets submitted and it does not pass through validate() function.
Any Suggestions.
Thanks
Haan
Comment