Form elements' "onreset" property is missing - by kangax

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

ID 612279 Comments
Status Closed Workarounds
Type Bug Repros 4
Opened 10/10/2010 9:36:57 AM
Access Restriction Public


It looks like `HTMLFormElement.prototype.onreset` is missing in IE9 beta. This leads to `document.createElement('form').onreset` being `undefined`, not `null` (as it is in other implementations).

This has 2 implications:

1) Assigning a function to form element's "onreset" property does not "create an event handler" (the function is not executed when reset event occurs).

   formEl.onreset = funciton(){ alert("this event handler is never executed") };

2) It breaks technique for event support detection, which is based on the inference that if event handler property (e.g. "onreset") is present on an element, corresponding event (e.g. "reset") is supported by that element.

   'onreset' in document.createElement('form'); // if `true`, "reset" event is support

Note that reset event is certainly supported by form elements, since event handler attribute (<form onreset="...">) works as expected.

Also note that `HTMLFormElement.prototype.onsubmit` is present and works as expected.
Sign in to post a comment.
Posted by Microsoft on 1/11/2012 at 7:37 AM
Thank you for your feedback.

This issue was resolved in Internet Explorer 9 released on 3/14/2011. Please verify the change and file a new feedback (or reactivate the existing one) if the problem persists.

Best regards,

The Internet Explorer Team
Posted by kangax on 10/28/2010 at 12:25 PM
This is now fixed in PP6. Thank you.
Posted by John-David Dalton [MSFT] on 10/11/2010 at 4:43 PM
I have made a test file here:

Firefox and Opera will return false or undefined for the tests while Chrome and IE < 9 will return `null` for form.onreset so it's a mixed bag cross-browser detection wise.

However I can confirm that the `onreset` DOM Lvl0 event handler is not getting triggered in IE9 and it is in other IE versions.