Site Navigation

Friday, October 26, 2007

bug 341 - the button element submits the wrong value in IE

Issue: #341
Affects: IE5, IE5.5, IE6, IE7
Fixed in: IE8 Beta 1

The button element in HTML, just like an input element (of type button) is designed (by spec) to submit the contents of the value attribute when it is pressed to submit a form. However in Internet Explorer, this functionality is broken as it submits the innerHTML of the button element rather than the contents of the value attribute.

Example:

<button value="true_content" name="doAction">
<span style="font-weight:bold;">Please</span> click <em>Me</em>!
</button>


If a user clicked this button, the server should get a parameter called "doAction" with a value of "true_content". IE on the other hand, will return the same parameter, with the value ' <span style="font-weight:bold;">Please</span> click <em>Me</em>!'.


Known Workarounds: None. See MSDN for the latest news on when the button element will be fixed.


Related Issues: bug 101.