Kung Fu Kung Fu

Fujian White Crane Kung Fu

Zope Zope

What I have and am doing with Zope

Photos Photos

Photoalbum, both old and new.

Receptsamlingen Receptsamlingen

In Swedish only. About my "Collection of Recipes" website.

Contact me Contact me

My contact details and how to contact me.

  Mobile version of this page Mobile version of this page


 

Labels in HTML forms

http://www.sitepoint.com/article/1273

forms, label, form, input, simon, willison

25th of January 2004

Simon Willison has written a nice article about Simple tricks for more usable forms and from it I learned about how <label> tags work. They have been part of HTML since 1998 so today most browsers should support them; and if not, it's not a show-stopper. What they do is that they help to associate a text with an input field. For example, here, mouseclick the word "Name" and "Agree?" below.

Name
Agree?

Nothing happens! Instead, with <label> tags, notice the difference when you mouseclick the words "Name" and "Agree?"


For code for the latter example is:

 <form>
 <label for="name2"><b>Name</b></label>  
 <input name="var21" id="name2"><br>
 <label for="agree2">Agree?</label>
 <input type="checkbox" name="var22" id="agree2">
 </form>


Comment

what - 18th May 2006  [«« Reply to this]
does not work
greenwald - 28th June 2006  [«« Reply to this]
whats the point?
 
Name:
Email:
hide my email address.

Your email address will be encoded to prevent email-extraction spiders from reading it so you won't get spammed if you decide to show your email address.