Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Andrew Crowe
February 10, 2004, 11:05 am
rate this thread
I have recently tried to make a complex edit form easier to understand by
using the <button> tag to add icons to buttons.
The form contains several submit buttons with different names/values to
control elements of the form such as adding/deleting rows in a repeating
However when I converted the <input> buttons to <button> buttons I found
that in PC IE clicking one resulted in *all* the button name/values being
submitted, not just the one clicked (making them totally useless). In
mozilla and other browsers the behaviour is that of <input> buttons, where
only the clicked button's name/value is submitted.
As the W3C html 4 spec says "Buttons created with the BUTTON element
function just like buttons created with the INPUT element" I'm guessing that
IE is (as usual) treating the buttons incorrectly. If so, does anyone know
rather not resort to using graphical <input> buttons
- Jukka K. Korpela
February 10, 2004, 6:00 pm
<button> is broken, both on browsers that don't support it and on
browsers like IE that do "support" it. Use <input> instead.
Especially in such cases run away from <button>.
Moreover, it uses the _content_ of the <button> element as the value,
not the value of the value="..." attribute.
<input type="submit"> rules OK.
If you think they will give users too many hints of what's going on,
like their being submit buttons, use CSS to tune the visual appearance.
Yucca, http://www.cs.tut.fi/~jkorpela /
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html