Why to NOT use a Text Link to Submit a HTML Form

I was recently asked to create a text link that would submit a form as part of a design for a client of mine. Through the process we eventually decided that using a text link is much more work and much less attractive then styling the button with CSS.

  1. Using a text link to submit a form requires Javascript. If a visitor’s browser does not support Javascript the form will not function.
  2. A text link is not very exciting. Text links do have high click through rates, but that does not apply to forms.
  3. Creating a CSS styled button is easier and loads faster.
  4. With creativity, a CSS styled button can be much more attractive

Here are a few simple examples to get started with.

Examples

To use simple add class=”buttonstyle” to any form for example.

<input class=”buttonstyle” type=”submit” value=”Submit” />


Button 1

Simple button
button1 Why to NOT use a Text Link to Submit a HTML Form

.buttonstyle {
background: #186DC2;
border: 1px solid #000000;
color: #FFFFFF;
}


Button 2

Simple button with rounded corners (not supported In IE)
button2 Why to NOT use a Text Link to Submit a HTML Form

.buttonstyle {
-moz-border-radius-bottomleft: 3px;
-moz-border-radius-bottomright: 4px;
-moz-border-radius-topleft: 3px;
-moz-border-radius-topright: 4px;
background: #186DC2;
border: 1px solid #000000;
color: #FFFFFF;
}


Button 3

Simple button with border
button3 Why to NOT use a Text Link to Submit a HTML Form

.buttonstyle {
background: #FFFFFF;
border: 1px solid #000000;
color: #000000;
}


Button 4

Text link button
button4 Why to NOT use a Text Link to Submit a HTML Form

.buttonstyle {
background: #FFFFFF;
color: #000000;
border: 1px solid #FFFFFF;
}


Button 5

Orange button with black border
button5 Why to NOT use a Text Link to Submit a HTML Form

.buttonstyle {
background: #F3BC2F;
color: #000000;
border: 1px solid #000000;
}


Button 6

Orange button with no border(inherits default border style)
button6 Why to NOT use a Text Link to Submit a HTML Form

.buttonstyle {
background: #F3BC2F;
color: #000000;
}


As you can see, with the proper styling, you can even create a button that will appear to be just like text. Of course it wont be text and you wont be able to select it, but I can not see a reason why you would need to anyways.

You can also use images and add hover effects to buttons as well, but I tend to feel that going that far is almost overkill. Plus IE doesn’t support :hover and requires a entire workaround to make it usable. If you are interested in using images or the hover effect I recommend you do a Google search to learn more details until I have more time to cover those options as well.

Technorati Tags: submit form text link, text link, submit form, html form, button style, styling buttons, html text, javascript text, javascript, css, css style, submit css, css class, form button, form, input form, javascript submit, form submit

Share/Save/Bookmark

One Response to “Why to NOT use a Text Link to Submit a HTML Form”


  1. hello it is test. WinRAR provides the full RAR and ZIP file support, can decompress CAB, GZIP, ACE and other archive formats.
    oaltcxusnepktayezggfqszbpbqvucrpqxchello

Leave a Reply