I would like to report this Windows Internet Explorer bug to save other greif. Seems that IE 6 (well, version: 6.0.2900.2180.xpsp_sp2_gdr.050301-1519 to be specific) doesn’t handle the <button> tag very well, especially when it is of type submit.
I have a form that allows multiple actions to be preformed on the selected data. Each action has a button with a value and they all share the same name. Something like:
<button type="submit" value="send_email" name="act">Send email</button>
<button type="submit" value="delete" name="act">Delete</button>
This button works but the value that IE submits is always ‘Delete’ (note the capital!?). Seem that when a form has more than one button of type submit IE will always pass the value of last one on the form no matter which button is pressed. This is not the case for <input> buttons.
Guess this means it doesn’t fully support HTML 4, or is this a ‘feature’ not a bug?
I found this with google. Here we are six months later and I’m still having one heck of a time with IE’s handling of “button” as described above.
What is recommended? Change all my buttons to inputs? I *just* finished changing them TO buttons for added value.
Ya, you have to change them to inputs to get it to work in IE6. IE7 is just around the corner but we’d still have to maintain backward compatibility for at least a year after its official realise.
Ugly but true.
I just got the same problem, but I found a hint to a solution there http://www.codecomments.com/JavaScript/message756646.html
However, the fix is incomplete, as the posted value is NOT the value specified withe the value attribute, but the *content* of the button tag (very disappointed, to say the least), so here is my patch :
function buttonfix(){
var buttons = document.getElementsByTagName(’button’);
for (var i=0; i
ooops, too long post, so here is the key line :
this.value = this.attributes.getNamedItem(”value”).nodeValue ;
I post a complete fix on my blog (in french, sorry, but the source code is there)
http://www.sporniket.com/page/blog/david/200601251721
NIce work mate. IE7 adoption seems to be happening at a rocketing rate, its around 35% of all IE usage at the time of writing.
I’ve documented the above solutions (with some enhancements) at:
http://www.kopz.org/public/documents/css/multiple_buttons_ie_workaround.html
I hope someone finds it useful.