Ticket #7161 (open bug)
Submit event on a form element not unbound properly in IE
| Reported by: | gethinw | Owned by: | gethinw |
|---|---|---|---|
| Priority: | undecided | Milestone: | |
| Component: | event | Version: | 1.4.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Submit events are not unbound fully from form elements in Internet Explorer. Would appear to be because jQuery.event.special.submit.setup (2199 in 1.4.2 source) is only applied if the element in question isn't a form, whereas the teardown function (2222) gets applied regardless, therefore not removing the standard submit event.
Change History
comment:1 Changed 5 months ago by addyosmani
- need changed from Review to Test Case
- Owner set to gethinw
- Status changed from new to pending
- Component changed from unfiled to event
comment:2 Changed 5 months ago by gethinw
OK - found an interesting twist on this while putting together a test case:
Bug is as previously described in http://fiddle.jshell.net/kytmD/2/ - if you 'Bind' then 'Unbind' then submit the form, an error will occur.
However, if the JS is run on load ('$(window).load(...)') rather than onReady ('$(...)') - http://fiddle.jshell.net/kytmD/1/ - the error doesn't occur. This would appear to be a side-effect of the fact that attaching a load event to the window creates an object in $(window).data('events'), the lack of which (at line 1919) causes the error in the other case, but as far as I can tell the handle function (1904) shouldn't be being called at all, so this is a coincidence rather than a fix.
comment:3 follow-up: ↓ 4 Changed 4 months ago by snover
- Status changed from new to pending
This ticket has been marked as missing a test case. In an effort to reduce the number of outstanding tickets in the bug tracker, it will be closed automatically in 30 days. In order to prevent this from happening, please provide a working test case. If a test case has already been provided and our records are wrong, please respond to the ticket so that it can be fixed. Thank you!
comment:4 in reply to: ↑ 3 Changed 4 months ago by gethinw
- Status changed from pending to new
Test case provided in comment:2
Replying to snover:
This ticket has been marked as missing a test case. In an effort to reduce the number of outstanding tickets in the bug tracker, it will be closed automatically in 30 days. In order to prevent this from happening, please provide a working test case. If a test case has already been provided and our records are wrong, please respond to the ticket so that it can be fixed. Thank you!
Please use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Could you submit a valid test case for us to see where this is breaking?.