• What can I do for you
  • Random
  • Archive
  • RSS
  • Ask me anything

Moisés García

Web Technology Specialist

Input type=submit VS Button type=submit

A partir de ahora en vez de utilizar en los formularios como Botón de submit el código siguiente:
<input type=”submit” name=”button1” value=”Button1” />

Voy a a utilizarlo así:
<button type=”submit” name=”button1” value=”somevalue”>Button1</button>

Las razones a favor:

  •     Es más fácil de darle estilo y de incluir elementos como imagenes, etc.
    Ejemplo: <button type=”submit”><img src=”icono.png” alt=”” /> Enviar</button>

    Buttons created with the BUTTON element function just like buttons created with the INPUT element, but they offer richer rendering possibilities: the BUTTON element may have content. For example, a BUTTONelement that contains an image functions like and may resemble an INPUT element whose type is set to “image”, but the BUTTON element type allows content.

    Visual user agents may render BUTTON buttons with relief and an up/down motion when clicked, while they may render INPUT buttons as “flat” images.

La única pega es que en IE6 (como no) en vez de enviar al form el value del button, envía el contenido del mismo. Pero eso a nosotros nos da igual pues nunca lo utilizamos para nada no?

http://www.peterbe.com/plog/button-tag-in-IE

  • 3 months ago
  • Comments
  • Permalink
  • Share

Recent comments

Blog comments powered by Disqus
← Previous • Next →

Portrait/Logo

About

Passionate web designer & developer, Tech lover, internet specialist and always hungry for knowledge.

Now located in Almería, Spain
Father of two, husband of one.

Where I Am

  • @moisesgarcia_es on Twitter
  • Facebook Profile
  • Google
  • Linkedin Profile

Twitter

loading tweets…

Dreamhost, hosting provider

Following

I Dig These Posts

See more →
  • Post via bricss
    Easily checking in JavaScript if a CSS media query has been executed

    For quite a while I have been looking for a way to “mirror” my CSS media queries...

    Post via bricss
  • Photo via staff

    We’re very excited to welcome Spanish into our roster of supported languages!

    Spanish is now our seventh language, following English, German,...

    Photo via staff
  • Link via azharkamar
    DHTMLX 3.0 – JavaScript UI Library with Visual Designer Tool
    Link via azharkamar
  • Photo via monochrom23reich

    Étienne Jules Marey

    Photo via monochrom23reich
  • Photo via ohscience
    The terrain for the scientific work conducted by ICESCAPE scientists on July 4, 2010, was Arctic sea ice and melt ponds in the Chukchi Sea. The...
    Photo via ohscience
  • RSS
  • Random
  • Archive
  • Ask me anything
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr