Nesting inside label tags is not a good idea?

Discussion in 'HTML' started by Samuël van Laere, Nov 17, 2003.

  1. 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
     
    Samuël van Laere, Nov 17, 2003
    #1
    1. Advertising

  2. "Samuël van Laere" <> 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
     
    Jukka K. Korpela, Nov 17, 2003
    #2
    1. Advertising

  3. "Jukka K. Korpela" <> 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
     
    Samuël van Laere, Nov 18, 2003
    #3
  4. Samuël van Laere

    Chris Morris Guest

    "Jukka K. Korpela" <> writes:
    > "Samuël van Laere" <> 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
     
    Chris Morris, Nov 18, 2003
    #4
  5. "Chris Morris" <> schreef in bericht
    news:...
    >
    > 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
     
    Samuël van Laere, Nov 18, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. A. Brinkmann
    Replies:
    2
    Views:
    1,118
    A. Brinkmann
    Apr 16, 2004
  2. Guy Noir
    Replies:
    4
    Views:
    460
    Guy Noir
    Nov 3, 2006
  3. Replies:
    10
    Views:
    1,274
    Big K
    Feb 2, 2005
  4. Trans
    Replies:
    10
    Views:
    327
    Sean O'Halpin
    Sep 16, 2005
  5. Knut Krueger
    Replies:
    8
    Views:
    337
    Knut Krueger
    Aug 20, 2013
Loading...

Share This Page