I made an image submit button with rollovers in a form using Javascript. On the href of my submit-image I call a javascript function to submit the form.
Once in the function I can't seem to make the mailto work.
This should work and actually does work when I call the function on the onSubmit of the form instead of the href of the submit-image.
Code:
function doSubmit(form){
form.action = 'mailto:myemail@email.com?subject=ItsNotWorking';
}
(...)
<a href="javascript:doSubmit(TheForm)" onMouseOut = "switchImage('submitImage',2)" onMouseOver = "switchImage('submitImage',3)" >
<img name="submitImage" src="images/bt_submit.gif" width="67" height="18" border="0"></a>
When I do this instead with the same function it works.
Code:
<FORM NAME="TheForm" ACTION="" METHOD="post" enctype="text/plain" onSubmit="return doSubmit(this)">
I just don't understand why it's not working when I call the function from the image. Any ideas?