#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: |
Description
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
Component: | unfiled → event |
---|---|
Owner: | set to baiamc |
Priority: | undecided → low |
Status: | new → pending |
comment:2 Changed 10 years ago by
Status: | pending → new |
---|
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:5 Changed 10 years ago by
Here is a possible polyfill for those who need it: http://etiennetalbot.github.io/formFive/
Right, the cause of the error is the HTML5
form
*attribute*, it is clobbering theform
*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) aform
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 aform
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?
Ref:
http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#association-of-controls-and-forms