tags:

views:

87

answers:

4

excuse me for the maybe very stupid question, but my curousity is killing me, and plus im new to this, but are using labels important in your markup, andh why?

i.e.

    <label for="birthdate">Birthdate:</label>
    <input type="text" id="birthdate" name="birthdate" />

why must i label this input, why is it beneficial to the user, why is going to be benficial for future use, or is it search engine optimastion thing. thats what i really wanna know,:))

thanks

p.s. feel free to take the mickey out of me lol

+3  A: 

It's important for accessibility, so blind people using screen readers can easily tell which text box is meant for which thing, since possibly otherwise their software cannot tell the purpose of the active text box from the page structure. Also, clicking on the label will focus the appropriate input control, which is convenient.

jjrv
It's not just convenient. For people like myself who have fine motor control issues (I have a Parkinson's-like condition) or for people using touch screens, it's pretty much essential from a usability point of view.
Stan Rogers
+5  A: 

It helps for accessibility, e.g. screen-readers.

Also for things like checkboxes it allows the user to click on the label and not just the checkbox itself (Try it!).

Adam
+13  A: 

It's important for a number of reasons

  • clicking the label focuses on the
    text field, which is something a lot of users expect
  • it's helpful for the accessibility reasons
  • how else is the user going to know which field is which? you could you
    just text or a span or something, but why would you?
  • It leads to a more semantic markup.
GSto
+1  A: 

Future use:

In a case where the input html form is directly linked with database ( happens in frameworks)

so the input form variables directly represent database columns.

So, instead of showing database column names to the user in the form, we can show simplified names to the user using Labels.

tecks