SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Guru
    Join Date
    Sep 2008
    Location
    Dubai
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    button submit or input submit better ?

    Hi,

    As far as i know, these do the same thing, and they look the same, so which one is used appropriate ?

    <button value="submit" type="submit" name="submit">submit</button>
    <input value="submit" type="submit" name="submit" />

  2. #2
    Guru in training bronze trophy SoulScratch's Avatar
    Join Date
    Apr 2006
    Location
    Maryland
    Posts
    1,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The button element is buggy in IE ( sends the innerHTML ), it's best to use input instead.
    Cross browser css bugs

    Dan Schulz you will be missed

  3. #3
    SitePoint Guru
    Join Date
    Sep 2008
    Location
    Dubai
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh I see.

    Thanks!

  4. #4
    SitePoint Wizard drhowarddrfine's Avatar
    Join Date
    Aug 2005
    Posts
    3,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SoulScratch View Post
    The button element is buggy in IE ( sends the innerHTML ), it's best to use input instead.
    THAT is one of the many things that started me on the road to wanting IE destroyed. Years ago, when I wasn't aware of that, and I was creating my first ecommerce site, I had to rewrite large portions of my code plus the HTML/CSS when we were nearly finished with the project before we realized what was going on.

  5. #5
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    An <input> button's text is specified in its value attribute, which means it can only be a simple text string. If that's all you need, using an <input> is the way to go.

    A <button> can have much richer content, even block-level elements. If you need a complex button you should use a <button>, but it does have some issues in some browsers.
    Birnam wood is come to Dunsinane


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •