WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: form label question

for

From: Kathleen Ballard
Date: Aug 8, 2007 6:10AM


Jukka,
Sorry, yes, display:block should have been
display:none. I guess I was typing too early in the
morning.

Unfortunately, for the current project, I have the
requirement for a small login form and search form on
each page that do not allow for visible labels in the
layout. The value of the textboxes when the page is
loaded will be the only visual cue to the user on the
form field functionality. ("Search site here")

Thank you for pointing out that title is the correct
attribute. The speaker used both alt and title and I
was not clear on which was the correct term.


Kathleen

-----Original Message-----
From: <EMAIL REMOVED>
[mailto: <EMAIL REMOVED> ] On
Behalf Of Jukka K. Korpela
Sent: Wednesday, August 08, 2007 7:47 AM
To: <EMAIL REMOVED> ; WebAIM Discussion List
Subject: Re: [WebAIM] form label question

On Wed, 8 Aug 2007, Kathleen Ballard wrote:

> Is using display: block to hide the labels and keep
> them available for screen readers a safe/accepted
> practice?

No, because labels and associated markup help far more
people than just
screen reader users. Everyone, and especially many
cognitively disabled
people, need well-written labels so that they know the
meaning of each
field.

I wonder how you expect display: block to hide
anything.

> Also, a recent webinar mentioned using the alt or
> title attribute of the form control itself.

That's pointless or worse. If you have good labels,
nobody needs such
attributes. If you don't, most people won't perceive
any labels.

> This
> would actually allowed giving the screen reader user
> better infromation about the form control. Ex:
> alt="Enter First Name required"

You must have confused attributes with each other. No
form field except
image submit button may have an alt attribute, by HTML
rules. You probably
mean the title attribute.

> Are both <label> and alt preferred? Or should one
be
> chosen over the the other?

Use good label texts and <label> markup to associate
them with fields.
That's it. No hassling around with fancy attributes.

--
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/