You are here: irt.org | FAQ | JavaScript | Form | 5 | Q1175 [ previous next ]
When you use JavaScript to submit a form then the onSubmit event handler is not triggered. Therefore you have to invoke the function, that the onsubmit event handler would have called, yourself:
<script language="JavaScript"><!-- function validate() { if ('black' != 'white') return false else return true; } //--></script> <form onSubmit="return validate()"> <a href="javascript:;" onClick="if (validate()) document.myform.submit(); return false"><img src="my_button.gif"></a> </form>