<button> tag problems in MSIE

A

Andrew Crowe

Hi guys,

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
section.

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
of any workarounds/fixes I can do? Javascript is not an option, and I'd
rather not resort to using graphical <input> buttons


Regards,
 
D

DU

Andrew said:
Hi guys,

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
section.

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
of any workarounds/fixes I can do? Javascript is not an option, and I'd
rather not resort to using graphical <input> buttons


Regards,

The default is type="submit", not type="button".

"submit: Creates a submit button. This is the default value."
http://www.w3.org/TR/html401/interact/forms.html#adef-type-BUTTON

DU
 
J

Jukka K. Korpela

Andrew Crowe said:
I have recently tried to make a complex edit form easier to
understand by using the <button> tag to add icons to buttons.

<button> is broken, both on browsers that don't support it and on
browsers like IE that do "support" it. Use said:
The form contains several submit buttons with different
names/values to control elements of the form such as
adding/deleting rows in a repeating section.

Especially in such cases run away from said:
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,

I'm guessing that IE is (as usual) treating the buttons
incorrectly.
Bingo.

If so, does anyone know of any workarounds/fixes I can
do? Javascript is not an option, and I'd rather not resort to using
graphical <input> buttons

<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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top