Skip to main content

Bug Tracker

Side navigation

#7381 closed bug (worksforme)

Opened November 02, 2010 04:08PM UTC

Closed November 02, 2010 06:08PM UTC

Last modified March 10, 2012 07:45AM UTC

.live binding of form submit event does not work in IE versions < 9

Reported by: Paul Payne <paul@iversant.com> Owned by:
Priority: undecided Milestone: 1.5
Component: unfiled Version: 1.4.3
Keywords: Cc:
Blocked by: Blocking:
Description

The following code produces a form with a jQuery live binding on the submit. In most browsers, this results in the alert "Submit event triggered" and the form should not be submitted. However, in Internet Explorer versions less than 9(beta), the form's live binding on the submit event is not triggered and the form submits to "fail.html".

This happens on all versions of jQuery.

<!DOCTYPE html>
<html>
<head>
  <title>jQuery Form Submit Test</title>
  <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.3.min.js"></script>
  <script type="text/javascript">
    $( function() {
      $('form').live('submit', function(e){
        alert('Submit event triggered');
        e.preventDefault();
      });
    });
  </script>
</head>
<body>
  <form data-remote="true" action="fail.html">
    <textarea></textarea>
    <input type="submit"/>
  </form>
</body>
</html>
Attachments (0)
Change History (5)

Changed November 02, 2010 05:59PM UTC by jitter comment:1

I can't reproduce this with jQuery 1.4.3 and IE 6

test case

Changed November 02, 2010 06:08PM UTC by rwaldron comment:2

resolution: → worksforme
status: newclosed

Thanks Jitter

Changed November 02, 2010 07:29PM UTC by dmethvin comment:3

Confirming that jitter's test case also works on IE8/Windows7.

Changed November 02, 2010 09:29PM UTC by paulrpayne comment:4

Retested... it appears this only fails when emulating ie7/8 on ie9beta. Which makes jquery code with ie9 difficult.

Changed November 02, 2010 10:29PM UTC by jitter comment:5

AFAIK jQuery doesn't support IE9 yet because of it's beta status