You are here: Re: <label> & <input> tags « HTML « IT news, forums, messages
Re: <label> & <input> tags

Posted by Jukka K. Korpela on 11/23/06 09:09

Scripsit Toby Inkster:

>> Can you nest input tags insde of label tags and do away with the for
>> attribute?
>> <p><label>Comments:<textarea name="textareaName" rows="4"
>> cols="40"></textarea></label></p>
>
> Yes, but Interner Explorer doesn't support this. (Not sure if it's
> been fixed in IE7.)

There's no specific support _required_ for the markup. The <label> markup is
declarative: it just specifies a logical relationship between some text and
some form field.

But I guess you mean the feature that by clicking on the label text, as
specified by the <label> markup, the form field can be focused on. This
feature exists in IE when "explicit" association with for and id attributes
has been established but not when "implicit" association (by nesting the
field inside the <label> element - rather illogical if you ask me!) is used.
This has been changed in IE 7, i.e. it recognizes the "implicit" association
too.

The feature is not particularly useful for <textarea>, since you can just as
well or better click on the area itself. It is much more useful for radio
buttons and checkboxes, which are rather small, creating a problem if you
are motorically challenged.

On the other hand, the explicit association has worked for a long time and
keeps working, and it is a more logical approach. The only drawbacks are
that you need a little more markup and you need to invent unique identifiers
for the fields.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация