Did a little further investigation on this...

I added a 'return false;' statement to the end of
jQuery.event.special.submit.setup,
'submit' is now handled but only after it's bubbled...

<html>
<head>
<script src="jquery.js"></script>

<script type="text/javascript">
  jQuery(function($) {
    $('#test-form').bind('submit', function(event) {
      alert('catch submit');
    });
    $('#test-bubble').bind('submit', function(event) {
      alert('submit bubbles');
    });
  });
</script>
</head>
<body>
  <h1>Submit Test</h1>
  <div id="test-bubble">
    <form id="test-form" action="javascript:alert('submitted');">
      <button type="submit">Submit</button>
    </form>
  </div>
</body>
</html>

You'll see 'submit bubbles', then 'catch submit' in IE, whereas the
other way round in other browsers.

2010/1/11 Mark Gibson <jollyt...@gmail.com>:
> Quick heads up... submit event is broken in IE8.
>
> Demo below. (tried using jsbin but the nightly build of jquery is out
> of date and very broken in IE! So this was tested against the latest
> from git)
>
> For jQuery 1.3.2 you'll see two alerts after clicking Submit... 'catch
> submit', then 'submitted'.
> In 1.4 the binding doesn't work and you won't see 'catch submit'.
>
> Commenting out the whole 'submit delegation' section of code in 1.4
> (lines 1760-1789) fixes the problem.
[snip]
-- 
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-...@googlegroups.com.
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en.


Reply via email to