View Full Version : Firefox and onsubmit

Davide Zanotti
04-28-2006, 03:36 PM
In firefox the callback setted for the onsubmit doesn't trigger, if the form is dynamically submitted by submit() method. I've searched on goolge and I found this http://www.gerd-riesselmann.net/archives/2005/04/firefox-canceling-problem-solved but, i don't understand how it works, moreover I don't use the attachEvent and the other techniques used by the author of the link, but instead I use form.onsubmit=mycallback.

Can someone help me?

04-28-2006, 10:21 PM
The onsubmit event isn't triggered by submit(). It's that simple.

You could do this though

<input type="button" onclick="if(this.form.onsubmit()) this.form.submit();">

Why do you want to use submit() anyway?

Keep in mind that some Internet users use a browser that doesn't have JavaScript enabled. (http://www.thecounter.com/stats/2006/March/javas.php)