Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Nesting inside label tags is not a good idea?

Reply
Thread Tools

Nesting inside label tags is not a good idea?

 
 
SamuŽl van Laere
Guest
Posts: n/a
 
      11-17-2003
I've had my website's test page tested by two visually impared internet
users,
they both are blind and as such use a device that allows them to read the
content of a website in braille.
The test was succesfull, though one of them told me that i should change
this:

<label for="radio">
<input name="radio" type="radio" id="radio1" value="1">
Oneens</label>

to this:

<input name="radio" type="radio" id="radio1" value="1">
<label for="radio1">Oneens</label>

Apperently some software called Jaws seems to like the latter best.
So in short i should not nest form elements in the label tags.

What are your opinions on this?



With regards,
SamuŽl van Laere






 
Reply With Quote
 
 
 
 
Jukka K. Korpela
Guest
Posts: n/a
 
      11-17-2003
"SamuŽl van Laere" <(E-Mail Removed)> wrote:

> <label for="radio">
> <input name="radio" type="radio" id="radio1" value="1">
> Oneens</label>
>
> to this:
>
> <input name="radio" type="radio" id="radio1" value="1">
> <label for="radio1">Oneens</label>
>
> Apperently some software called Jaws seems to like the latter best.


Both constructs are correct, not just syntactically but also by WAI
guidelines.

In the former case, you could omit the for="..." and id="..." attributes, as
far as logic goes, but due to practical problems in browsers, it's probably
best to keep the redundant markup.

The choice between the two is not clearcut, since the former helps people
with motoric disabilities. The reason is that on IE, it creates a situation
where you can click on the label text to toggle the radio button setting,
instead of needing to hit the small button. (See
http://www.cs.tut.fi/~jkorpela/forms/kbd.html )

Anyway, if you stick to the simple rule of putting just one logical entry
(an input field and the associated label text) on one line, I think
accessibility will be much above the average and things should work
reasonably on speech browsers too. The extra features created by <label> can
be nice, but usually not vital.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


 
Reply With Quote
 
 
 
 
SamuŽl van Laere
Guest
Posts: n/a
 
      11-18-2003
"Jukka K. Korpela" <(E-Mail Removed)> schreef in bericht
news:Xns94379B2EF403jkorpelacstutfi@193.229.0.31.. .
> Both constructs are correct, not just syntactically but also by WAI
> guidelines.
>
> In the former case, you could omit the for="..." and id="..." attributes,

as
> far as logic goes, but due to practical problems in browsers, it's

probably
> best to keep the redundant markup.
>
> The choice between the two is not clearcut, since the former helps people
> with motoric disabilities. The reason is that on IE, it creates a

situation
> where you can click on the label text to toggle the radio button setting,
> instead of needing to hit the small button. (See
> http://www.cs.tut.fi/~jkorpela/forms/kbd.html )
>
> Anyway, if you stick to the simple rule of putting just one logical entry
> (an input field and the associated label text) on one line, I think
> accessibility will be much above the average and things should work
> reasonably on speech browsers too. The extra features created by <label>

can
> be nice, but usually not vital.
>
> --
> Yucca, http://www.cs.tut.fi/~jkorpela/
> Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
>
>


Well i've learned something new here Yucca, you've got all the information i
need right on your site.
Bookmarked it allready.

Thanks for the wise words.


Regards,
SamuŽl van Laere


 
Reply With Quote
 
Chris Morris
Guest
Posts: n/a
 
      11-18-2003
"Jukka K. Korpela" <(E-Mail Removed)> writes:
> "SamuŽl van Laere" <(E-Mail Removed)> wrote:
> > <label for="radio">
> > <input name="radio" type="radio" id="radio1" value="1">
> > Oneens</label>
> >
> > <input name="radio" type="radio" id="radio1" value="1">
> > <label for="radio1">Oneens</label>

>
> The choice between the two is not clearcut, since the former helps people
> with motoric disabilities. The reason is that on IE, it creates a situation
> where you can click on the label text to toggle the radio button setting,
> instead of needing to hit the small button. (See
> http://www.cs.tut.fi/~jkorpela/forms/kbd.html )


As far as I can tell from testing, IE 4-6 [1] (and Opera, Mozilla, for
that matter) will do that in either case, regardless of whether the
input is inside or outside the label.
http://www.dur.ac.uk/c.i.morris/formtest.html

--
Chris
 
Reply With Quote
 
SamuŽl van Laere
Guest
Posts: n/a
 
      11-18-2003
"Chris Morris" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
>
> As far as I can tell from testing, IE 4-6 [1] (and Opera, Mozilla, for
> that matter) will do that in either case, regardless of whether the
> input is inside or outside the label.
> http://www.dur.ac.uk/c.i.morris/formtest.html
>
> --
> Chris


I've tested it on IE5.5, IE6.0, Mozilla 1.5 and Opera 7.20 and it works.
Since it works i might as well change it, Jaws user's will sure be
gratefull.
Thanks for the effort Chris.


With regards,
SamuŽl van Laere









 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nesting an asp:label control inside of an asp:table Guy Noir ASP .Net 4 11-03-2006 02:00 AM
Module.nesting -> Kernel#nesting Trans Ruby 10 09-16-2005 12:21 AM
Nesting Literal Control in anchor tags Spondishy ASP .Net 5 03-21-2005 06:49 PM
Evaluating struts tags inside my own custom tags... A. Brinkmann Java 2 04-16-2004 07:44 AM
Nesting object tags in ASP 3.0, ASP.NET & Internet Explorer DeadlyTedly ASP .Net 2 10-16-2003 08:32 AM



Advertisments