WebAIM - Web Accessibility In Mind

E-mail List Archives

FW: Adding a label to search box

for

From: Jim Thatcher
Date: Apr 17, 2006 11:40AM


Hi Larry,



Larry Hull:

>Accessibility checking tools will for the most part fail a page if

>the label element isn't used for a search box.



I am not sure what "for the most part" means. I tested 6 commercial tools
and three passed the page when the form control had a title attribute
instead of the label. Those that passed were InFocus, Ramp, and WebKing.
Those that failed were Bobby, The Lift Machine and WebXM. There will be more
about these tests on my site shortly.



So half the tools I looked at failed the page if the title was used instead
of the label. I hope and believe that will change in the near future.



IBM uses an invisible image with alt="search for:" enclosed in the label
element; it is my understanding they use this technique instead of title for
just the reason you state.





Larry Hull:

> some sophisticated accessibility checking tools still fail the

> page because the label is empty, i.e., doesn't contain explicit

> on-screen text



In my tests all 6 tools passed the page if the label element contained an
image with non-empty alt-text. So which "sophisticated tools" are you
talking about? I would like to include them at some later time.



Jim



Accessibility Consulting: http://jimthatcher.com/

512-306-0931

-----Original Message-----
From: <EMAIL REMOVED> [mailto: <EMAIL REMOVED> ]
Sent: Monday, April 17, 2006 9:32 AM
To: <EMAIL REMOVED>
Cc: <EMAIL REMOVED>
Subject: Re: [WebAIM] Adding a label to search box



Jim,



For a maintenance standpoint, I agree with you.



However....



Accessibility checking tools will for the most part fail a page if the label
element isn't used for a search box. In my experience, this tends to confuse
people who are just trying to do the "right thing" when it comes to
accessibility.



Recently I've been seeing a number of examples of a search box with no
on-screen text. An image with a picture of the word "Search" and alt text
for the image that reads "Search" is used.



In many of these examples, a label element often encloses the image, IMHO
because many accessibility checking tools will otherwise fail the page.



A brief digression: some sophisticated accessibility checking tools still
fail the page because the label is empty, i.e., doesn't contain explicit
on-screen text.



Whether or not an empty label is used, the alt text is read in this case and
I don't believe a title attribute is needed.



Please correct me if I'm wrong.



Regards,



Larry Hull



In a message dated 4/15/2006 10:47:38 A.M. Eastern Standard Time,
<EMAIL REMOVED> writes:

> if I used label for and the title attribute on a form,
> would a person using speech hear the same text twice?

Remember that more is not better. You won't hear the information twice, but
it is not predictable which a given screen reader will announce. So for
maintenance reasons use label when on-screen text is available, title when
it is not and don't use both!

Jim

Accessibility Consulting: http://jimthatcher.com/
512-306-0931