<button> tag problems in MSIE

Discussion in 'HTML' started by Andrew Crowe, Feb 10, 2004.

  1. Andrew Crowe

    Andrew Crowe Guest

    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,
    --
    Andrew Crowe
    Andrew Crowe, Feb 10, 2004
    #1
    1. Advertising

  2. Andrew Crowe

    DU Guest

    Andrew Crowe wrote:
    > 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
    DU, Feb 10, 2004
    #2
    1. Advertising

  3. "Andrew Crowe" <> wrote:

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

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

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


    Moreover, it uses the _content_ of the <button> element as the value,
    not the value of the value="..." attribute.

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

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Feb 10, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    8
    Views:
    405
    Andrew Thompson
    Jan 22, 2005
  2. shruds
    Replies:
    1
    Views:
    779
    John C. Bollinger
    Jan 27, 2006
  3. Replies:
    0
    Views:
    343
  4. Replies:
    0
    Views:
    335
  5. Replies:
    0
    Views:
    397
Loading...

Share This Page