Skip to main content

Bug Tracker

Side navigation

#12717 closed bug (wontfix)

Opened October 12, 2012 04:00PM UTC

Closed October 15, 2012 02:12PM UTC

Last modified July 29, 2013 09:44PM UTC

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.

http://jsfiddle.net/w5b9H/3/

Attachments (0)
Change History (5)

Changed October 12, 2012 06:55PM UTC by dmethvin comment:1

component: unfiledevent
owner: → 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?

Ref:

http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#association-of-controls-and-forms

Changed October 15, 2012 02:08PM UTC by baiamc comment:2

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.

Changed October 15, 2012 02:12PM UTC by dmethvin comment:3

resolution: → wontfix
status: newclosed

OK, thanks!

Changed July 11, 2013 06:31PM UTC by dmethvin comment:4

#14126 is a duplicate of this ticket.

Changed July 29, 2013 09:44PM UTC by anonymous comment:5

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