WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: One question: regarding label for attribute

for

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

From: 김형섭
Date: Mon, Jun 06 2016 8:55AM
Subject: One question: regarding label for attribute
No previous message | Next message →

Hello, I'm Hyongsop Kim in Korea and web accessibility tester.
I want to ask your opinion about label for attribute in specific condition.
The condition is that in common case, label tag and input tag is separated.
So I add for attribute in label tag and add id attribute in input tag to correspond each other.
By the way, if input tag is inside label tag, I'm a little confused.
Below is the example code.
<label><input type="checkbox">automatic login</label>
In above code, I know that input tag is inside label tag, there is no need to add id and for attribute.
But unlide NVDA screen reader, our Korean screen reader doesn't support this kind label, so if I press tab key, screen reader says only checkbox with no label.
So how can I solve this problem?
If I add for attribute in label tag and id attribute in input tag, in above code, is this okay?
Thank you for your advice.

From: Steve Faulkner
Date: Mon, Jun 06 2016 10:14AM
Subject: Re: One question: regarding label for attribute
← Previous message | Next message →

On 6 June 2016 at 15:55, 김형섭 < = EMAIL ADDRESS REMOVED = > wrote:

> If I add for attribute in label tag and id attribute in input tag, in
> above code, is this okay?


yes it is perfectly OK to do this.

--

Regards

SteveF
Current Standards Work @W3C
<http://www.paciellogroup.com/blog/2015/03/current-standards-work-at-w3c/>;

From: Aaron Cannon
Date: Mon, Jun 06 2016 10:26AM
Subject: Re: One question: regarding label for attribute
← Previous message | Next message →

I recently heard that wrapping an input tag with a label tag, and
also using the for attribute on the label to associate it with the
input, will cause VoiceOver on the Mac to read the label twice. I
haven't verified this, however. Has anyone else noticed this
behavior?

But even if it is true, it's probably better to have it read twice in
one screen reader, than not at all in another.

Aaron

On 6/6/16, Steve Faulkner < = EMAIL ADDRESS REMOVED = > wrote:
> On 6 June 2016 at 15:55, 김형섭 < = EMAIL ADDRESS REMOVED = > wrote:
>
>> If I add for attribute in label tag and id attribute in input tag, in
>> above code, is this okay?
>
>
> yes it is perfectly OK to do this.
>
> --
>
> Regards
>
> SteveF
> Current Standards Work @W3C
> <http://www.paciellogroup.com/blog/2015/03/current-standards-work-at-w3c/>;
> > > > >

From: Teresa Haven
Date: Mon, Jun 06 2016 10:32AM
Subject: Re: One question: regarding label for attribute
← Previous message | Next message →

Hi, Aaron. I had that same thing happen, and decided that although it may be annoying, it's still better to have the label read twice than not at all.


Teresa Haven, Ph.D.
Accessibility Analyst, Northern Arizona University



-----Original Message-----
From: WebAIM-Forum [mailto: = EMAIL ADDRESS REMOVED = ] On Behalf Of Aaron Cannon
Sent: Monday, June 06, 2016 9:26 AM
To: WebAIM Discussion List < = EMAIL ADDRESS REMOVED = >
Subject: Re: [WebAIM] One question: regarding label for attribute

I recently heard that wrapping an input tag with a label tag, and also using the for attribute on the label to associate it with the input, will cause VoiceOver on the Mac to read the label twice. I haven't verified this, however. Has anyone else noticed this behavior?

But even if it is true, it's probably better to have it read twice in one screen reader, than not at all in another.

Aaron

On 6/6/16, Steve Faulkner < = EMAIL ADDRESS REMOVED = > wrote:
> On 6 June 2016 at 15:55, 김형섭 < = EMAIL ADDRESS REMOVED = > wrote:
>
>> If I add for attribute in label tag and id attribute in input tag, in
>> above code, is this okay?
>
>
> yes it is perfectly OK to do this.
>
> --
>
> Regards
>
> SteveF
> Current Standards Work @W3C
> <http://www.paciellogroup.com/blog/2015/03/current-standards-work-at-w
> 3c/> > > archives at http://webaim.org/discussion/archives
> >

From: Jared Smith
Date: Mon, Jun 06 2016 11:22AM
Subject: Re: One question: regarding label for attribute
← Previous message | No next message

I think that what everyone is saying is that the optimal markup uses for/id
but does NOT have the input within the label element. This will be
universally supported and will not caused things to be read twice.

Jared