Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Feb 2006
    Location
    Italy
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Firefox and onsubmit

    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/arch...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?

  • #2
    Senior Coder
    Join Date
    Feb 2006
    Location
    USA
    Posts
    1,013
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The onsubmit event isn't triggered by submit(). It's that simple.

    You could do this though
    Code:
    <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.
    Learn CSS. | SSI | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions
    Java != JavaScript && JScript != JavaScript
    Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •