WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: Label for and input id--basic question revisited.

for

Number of posts in this thread: 6 (In chronological order)

From: Nancy Johnson
Date: Fri, Jan 24 2014 8:28AM
Subject: Label for and input id--basic question revisited.
No previous message | Next message →

2 Questions :

If the the label and input abut each other in the layout, is 'label
for' 'id' necessary?
<label class="someclass" label for="name">name</label><input
type="text" id="name">

If the label wraps around the input is 'label for' 'id' necessary?
<label class="someclass">name<input type="text"></label>

My understanding was the labeling came at a time when we all used
layout tables and the label was in one column and input in another
column?

Thanks

Nancy

From: Steve Faulkner
Date: Fri, Jan 24 2014 8:32AM
Subject: Re: Label for and input id--basic question revisited.
← Previous message | Next message →

case 1 for/id is necessary
case 2 for/id is not necessary

here are some tests i carried out a few years back:
http://www.html5accessibility.com/tests/form-labels.html

--

Regards

SteveF
HTML 5.1 <http://www.w3.org/html/wg/drafts/html/master/>;


On 24 January 2014 15:28, Nancy Johnson < = EMAIL ADDRESS REMOVED = > wrote:

> 2 Questions :
>
> If the the label and input abut each other in the layout, is 'label
> for' 'id' necessary?
> <label class="someclass" label for="name">name</label><input
> type="text" id="name">
>
> If the label wraps around the input is 'label for' 'id' necessary?
> <label class="someclass">name<input type="text"></label>
>
> My understanding was the labeling came at a time when we all used
> layout tables and the label was in one column and input in another
> column?
>
> Thanks
>
> Nancy
> > > >

From: Lewis Phillips
Date: Fri, Jan 24 2014 8:37AM
Subject: Re: Label for and input id--basic question revisited.
← Previous message | Next message →

I've always recommended using the for/id for future proofing - in case the
form element is moved during a redesign and the label isn't moved correctly
at the same time.

Lewis


On Fri, Jan 24, 2014 at 9:32 AM, Steve Faulkner < = EMAIL ADDRESS REMOVED = >wrote:

> case 1 for/id is necessary
> case 2 for/id is not necessary
>
> here are some tests i carried out a few years back:
> http://www.html5accessibility.com/tests/form-labels.html
>
> --
>
> Regards
>
> SteveF
> HTML 5.1 <http://www.w3.org/html/wg/drafts/html/master/>;
>
>
> On 24 January 2014 15:28, Nancy Johnson < = EMAIL ADDRESS REMOVED = > wrote:
>
> > 2 Questions :
> >
> > If the the label and input abut each other in the layout, is 'label
> > for' 'id' necessary?
> > <label class="someclass" label for="name">name</label><input
> > type="text" id="name">
> >
> > If the label wraps around the input is 'label for' 'id' necessary?
> > <label class="someclass">name<input type="text"></label>
> >
> > My understanding was the labeling came at a time when we all used
> > layout tables and the label was in one column and input in another
> > column?
> >
> > Thanks
> >
> > Nancy
> > > > > > > >
> > > >

From: Paul J. Adam
Date: Fri, Jan 24 2014 8:50AM
Subject: Re: Label for and input id--basic question revisited.
← Previous message | Next message →

So where do wrapped labels not work?

They are less code.


Paul J. Adam
Accessibility Evangelist
www.deque.com

On Jan 24, 2014, at 9:32 AM, Steve Faulkner < = EMAIL ADDRESS REMOVED = > wrote:

> case 1 for/id is necessary
> case 2 for/id is not necessary
>
> here are some tests i carried out a few years back:
> http://www.html5accessibility.com/tests/form-labels.html
>
> --
>
> Regards
>
> SteveF
> HTML 5.1 <http://www.w3.org/html/wg/drafts/html/master/>;
>
>
> On 24 January 2014 15:28, Nancy Johnson < = EMAIL ADDRESS REMOVED = > wrote:
>
>> 2 Questions :
>>
>> If the the label and input abut each other in the layout, is 'label
>> for' 'id' necessary?
>> <label class="someclass" label for="name">name</label><input
>> type="text" id="name">
>>
>> If the label wraps around the input is 'label for' 'id' necessary?
>> <label class="someclass">name<input type="text"></label>
>>
>> My understanding was the labeling came at a time when we all used
>> layout tables and the label was in one column and input in another
>> column?
>>
>> Thanks
>>
>> Nancy
>> >> >> >>
> > >

From: Iaffaldano, Michelangelo
Date: Fri, Jan 24 2014 10:38AM
Subject: Re: Label for and input id--basic question revisited.
← Previous message | Next message →

Explicit labels are necessary for users of voice input. Dragon Naturally Speaking and such are less forgiving than screen readers when it comes to markup.

Michelangelo

From: Paul J. Adam
Date: Fri, Jan 24 2014 11:32AM
Subject: Re: Label for and input id--basic question revisited.
← Previous message | No next message

Sounds like a bug in the AT. Does dragon have a place to file bug reports?

Has anyone documented all the possible ways to create an accessible name for a form control that actually works in Dragon? I’ve heard the title attribute works. I know that WAI-ARIA does not work. Seems silly that a wrapped label would not work, wrapped labels still retain the larger click target area, click on the label will set focus to the input just like a for/id connection so I see no reason why wrapped labels should not work in Dragon.

I’d love to see someone post a video of what works and does not work for HTML user interface controls in Dragon!


Paul J. Adam
Accessibility Evangelist
www.deque.com

On Jan 24, 2014, at 11:38 AM, Iaffaldano, Michelangelo < = EMAIL ADDRESS REMOVED = > wrote:

> Explicit labels are necessary for users of voice input. Dragon Naturally Speaking and such are less forgiving than screen readers when it comes to markup.
>
> Michelangelo
>
>