Well, I think you are doing it difficult for yourself! Couldn't you just do like this...
Code:
<FORM name="form1" method="post" onSubmit="submit_if_validate('form1'); return;">
...
<INPUT type="image" src="btn_submit.gif" name="submitbtn">
...
</FORM>
...? and then have a JavaScript that submits if the validate function passes!? Something like...
Code:
function submit_if_validate(someForm)
{
if(validate()) document[someForm].submit();
}
function validate()
{
// some validation code that returns true if it passes and false otherwise.
}
The code is not tested but it should work. I have done something similar myself ;) This way it should be less error-prone.
Jacob.