Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#12717 closed bug (wontfix)

Delegated submit event handler throws errors with HTML5 form attribute

Reported by: baiamc Owned by: baiamc
Priority: low Milestone: None
Component: event Version: 1.8.2
Keywords: Cc:
Blocked by: Blocking:


In IE8, when there is a delegated submit event handler, and input elements with the form attribute specified, events triggered on the input elements cause JavaScript errors in the delegated submit handler code.

This error happens in versions 1.8.2 and 1.7.2. Version 1.6.4 doesn't cause errors for events triggered on the input elements, but does throw an error in the document.ready code.


Change History (5)

comment:1 Changed 10 years ago by dmethvin

Component: unfiledevent
Owner: set to baiamc
Priority: undecidedlow
Status: newpending

Right, the cause of the error is the HTML5 form *attribute*, it is clobbering the form *property* that we need for oldIE to properly implement delegated events.

We could make this one case work by seeing if the elem.form *property* is a string; if it is, look it up as an id in the document and use that element. However, that won't handle the more general case such as an element being outside the form or (horror) a form attribute of a different form than the one it's inside.

Bottom line, oldIE doesn't comprehend HTML5 form attribute semantics--honestly I don't get why they're needed anyway. And really, there is no good reason to specify a form attribute at all if you have to follow the HTML4 rules and nest things properly.

Right now I'm inclined to close this wontfix given the oldIE limits. Is there a reason why you're using the form attribute here, where it's not needed?



comment:2 Changed 10 years ago by baiamc

Status: pendingnew

For the actual code (which I'm not free to post) has multiple forms, where a submit button at the bottom needs to trigger a submit on a form further up the page, but can't be included in that form.

It's easy enough to handle without the form attribute on the submit button, and I was only planning to use the form attribute to write a generic handler for all cases where I needed to use a submit button that wasn't inside the form it was submitting, instead of more specific handlers for each case.

Based on the info you've provided, I'd be fine with closing this as wontfix.

comment:3 Changed 10 years ago by dmethvin

Resolution: wontfix
Status: newclosed

OK, thanks!

comment:4 Changed 10 years ago by dmethvin

#14126 is a duplicate of this ticket.

comment:5 Changed 10 years ago by anonymous

Here is a possible polyfill for those who need it: http://etiennetalbot.github.io/formFive/

Note: See TracTickets for help on using tickets.