E-mail List Archives

Re: Label vs ALT tag on form elements

for

From: Jukka K. Korpela
Date: Mar 21, 2007 11:50AM


On Wed, 21 Mar 2007, Derek Featherstone - furtherAhead.com wrote:

> As far as I am aware, the alt attribute for a form field is to provide
> an alernate for user agents that either don't support that particular
> form control or (perhaps) the scenario where that support is turned off
> - much the same way as alt serves that purpose for images.

The relevant specification at
http://www.w3.org/TR/html401/struct/objects.html#adef-alt
describes things along such lines, but it's really just babbling. The real
story is that the alt attribute for <input> was introduced (and has been
implemented) for the case <input type="image" ...> only.

> I believe it has some support in A[L]T for input type=image as a screen
> reader will read that alt text if present. Not sure of any support
> outside that.

Graphic browsers generally use the alt attribute value when the image
cannot be retrieved or the browser has been instructed not to show images.
Text-only browsers use it too. However, support has not been quite
universal, so the traditional wisdom is to say the same thing in three
ways, using three attributes that might be used by different browsers as
the alternate text, e.g.

<input type="image" name="Search" value="Search" alt="Search">

Of course, a normal submit button is still better for accessibility.

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