Christopher Benson-Manica wrote:
Why the heck doesn't document.aForm.submit() invoke aForm's onSubmit event
handler?
Because it doesn't.
If you want it to, use Opera 7.0 or 7.1 which had a bug that caused that
behaviour (it's been fixed in 7.21).
The obviously solution is to call the validator code before calling submit():
<a href="noJS.html" onclick="
var f=document.forms['aForm'];
if (validate(f)) f.submit();
">Submit</a>
This would have the same effect as:
<form ... onsubmit="return validate(this);">
<input type="submit" ... />
</form>
--
| Grant Wagner <gw*****@agricoreunited.com>
* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html
* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp
* Netscape 6/7 DOM Reference available at:
*
http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
*
http://www.mozilla.org/docs/web-deve...upgrade_2.html