I have a JS validation function that works just fine.
I want to modify it so it validates on the form submit
(which it does) but only when the submit button value is "commit" and not "save". So I added to the function:
&& (document.form1.submitButton == 'commit' )
Well now it dosen't alert when the save button is clicked
which is a good thing but it won't validate when the commit button is clicked.
The input for the commit is :
<INPUT type="submit" Value="commit" name="commit">
The function above is a lot longer than the example but its redundant info so I ommited alot of it.
Thanks
Dan
I want to modify it so it validates on the form submit
(which it does) but only when the submit button value is "commit" and not "save". So I added to the function:
&& (document.form1.submitButton == 'commit' )
Well now it dosen't alert when the save button is clicked
which is a good thing but it won't validate when the commit button is clicked.
The input for the commit is :
<INPUT type="submit" Value="commit" name="commit">
Code:
function validate_form() {
if (( document.form1.cpd3.checked == false )&& ( document.form1.cpd4.checked == false ) && ( document.form1.cpd5.checked == false ) && ( document.form1.cpd37.checked == false ) && (document.form1.submitButton == 'commit' ))
{
alert ( "Please check one of the Quality checkboxes." );
valid = false;
}
)
The function above is a lot longer than the example but its redundant info so I ommited alot of it.
Thanks
Dan