Bug Tracker

Opened 6 years ago

Closed 6 years ago

#14126 closed bug (duplicate)

Submit-event fails on IE7&IE8 when submit-button have "form"-attribute

Reported by: Otto-Ville Lamminpää Owned by: Otto-Ville Lamminpää
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:

Description

See jsfiddle: http://jsfiddle.net/xhvwh/

When there is event listener for submit, and submit button have "form" attribute, clicking the button causes error on line 3634 "thisCache[ jQuery.camelCase( name ) ] = data;"

This does happen in IE 7 and IE 8

It does not matter if there actually are form with same id-attribute or not.

Change History (3)

comment:1 Changed 6 years ago by dmethvin

Owner: set to Otto-Ville Lamminpää
Status: newpending

Are you talking about the HTML5 `form` attribute? In your example there is no form named "test" which would make the markup invalid even in HTML5, since the spec says the value should be the ID of a form element.

Unfortunately the HTML5 spec didn't consider the backcompat issues there. For example, IE7 does not distinguish form *properties* as opposed to form *attributes*. There is a DOM0 form *property* already that represents a reference to the owning form DOM element, so oldIE can't deal with a form *attribute* that is a string.

In any case, can you clarify what you're doing and create a valid example?

comment:2 Changed 6 years ago by Otto-Ville Lamminpää

Status: pendingnew

As I wrote in my previous post, it does not count if there are actually form with right id or not. To prove that I created another jsfiddle with form: http://jsfiddle.net/26RZe/embedded/result/

Internet Explorer 7 and 8 does not support HTML5 'form'-attribute, and they does not have any native behavior for the attribute. I noticed this bug in jQuery, when I was creating a polyfill for IE8 to support the HTML5's 'form'-attribute.

comment:3 Changed 6 years ago by dmethvin

Resolution: duplicate
Status: newclosed

Duplicate of #12717.
> Internet Explorer 7 and 8 does not support HTML5 'form'-attribute, and they does not have any native behavior for the attribute.

Right, but all browsers have had a form *property* on input elements since DOM0 days. Try the following fiddle in IE7: http://jsfiddle.net/26RZe/2/ . Looks like the same issue as #12717.

I noticed this bug in jQuery, when I was creating a polyfill for IE8 to support the HTML5's 'form'-attribute.

If you can come up with a complete working shim and this is holding you back, we can implement a change to support your polyfill if it is small. For now, just override jQuery.event.special.submit.setup in your polyfill and figure out how to change the code to deal with the problem of the DOM object property being clobbered by the string attribute in IE7.

https://github.com/jquery/jquery/blob/4b7a0d4e0afa11db4ed523c2c1f4ffc3b2cc2823/src/event.js#L777

Note: See TracTickets for help on using tickets.