Re: Label versus Title

Thanks everyone for your feedback. Here are some responses followed by a
summary:

David Woolley at david@djwhome.demon.co.uk wrote in response to my original
query:

>> <label for="month">Please enter your birth month and year:</label> <input
>> type="text" id="month"> <input type="text" id="year" title="Enter year">
> 
> This is a misuse of title; an appropriate title might be "year of birth".

Regardless of the actual way titles should and should not be worded, I
didn't like this approach for the simple fact that it feels like a hack. To
use input for one and title for another smacks of working around buggy
browsers. A necessary evil at times, but in this case it felt just plain
wrong. I am not going to go down this road if I can help it. As long as the
text of the label for the multiple elements allows me to stick two+ label
tags in it (as they do in the next example) I will go that way. I will also
encourage our developers to make it possible or to simply avoid these
situations entirely except for cases where that's impossible or where doing
so would create a silly form.

> 
>> <label for="month">Please enter your birth month</label> and <label
>> for="year">year</label>:<input type="text" id="month"> <input type="text"
>> id="year">
> 
> I don't think "Please enter your" is really part of the label, but otherwise
> this makes sense.  I would say that it benefits all users, so doesn't
> need to be justified on accessibility grounds.

I agree and like this approach the best after everything I have read in
reply.

> 
>> <label for="month">Please enter your birth month</label> and year:<input
>> type="text" id="month"><span class="invisibleText"><label for="year">Enter
>> your birth year</label></span> <input type="text" id="year">
> 
> No on two grounds:
> 
> - you've lost the usability to general users;

Good point. I get so hung up on accessibility that I sometimes forget that
things have to make sense to *everyone*, not just the folks using screen
readers, etc.

> - this is a misuse of span; the class should be on the label.

Duh. My bad. I don't know where my head was at. I should have caught that.


Jim Thatcher at jim@jimthatcher.com wrote:

> If you use LABEL as a container for the INPUT element as well as the text,
> then screen readers will ignore it. So don't do that.

I never suggest our developers wrap label and input inside the label tag
because of the various problems. We always use <label for="">label
text</label><input id=""> etc.




Al Gilman at asgilman@iamdigex.net wrote:

> What use are FIELDSET and LEGEND for this example?

They are at a much higher level. I was picking on a *single line* of a much
larger block which is inside a fieldset with the legend "Personal
Information" so they would be of no use to me in this context.


Al Gilman at asgilman@iamdigex.net wrote:

> Using just one label when you have split the entry into two form controls is
> pretty confusing.  Particularly when the questions deal with information which
> you will frequently find combined in one field.

Would that the html specifications allow for more flexible input controls so
it *could* be a single field. The alternative here is to have a text box and
a line in the label specifying mm/yyyy format and a lot of go-arounds back
to the user when they get the input wrong. In the *real* example which I
vaslty simplified for clarity in my original post, the first of the two
inputs is actually a select pop-up menu for the month and the second is a
text box for the year (though I plan on going back to the developer to
encourage him to use a select box for that as well... Or two, one for
century and the other for the decade/year as yyyy isn't much easier. Most
people will just enter 68 for 1968 when we need all four digits.)


> For best results they should first warn people that there are two fields
> related to when you were born, and then ask for birth month and birth year
> control by control.

But can this be done without making the form pedantic or too wordy? I also
worry that simple forms will end up being very long and tedious to fill in
if done this way. Maybe I'm overreacting. I won't really know until we try
it in-house and see how things look. But we will try this as a way around
the original problem.

> Particularly for date of birth, which is so common, to ask for only the month
> and year is truly weird.  In cases like that where you are ever so close to a
> true cliche, it's advisable to hit the user up the side of the head with
> everything you have got.  NOW HEAR THIS and very clear instructions so they
> know what weird stuff you are up to.

Except there are limits to what we are allowed to ask on the forms. This is
for a federal contract and there are SO MANY RULES involved with what can be
asked where, when and by whom. So, we need to err on the side of asking only
enough to get what we need without getting into privacy issues.



In summary, the approach I think we will use (unless someone here has a
better idea to offer) is the following:

1) Avoid, where possible, having one label for two+ input controls as much
as possible. Go wordy if we can and if it doesn't make the form silly in its
length and/or wordiness and if it doesn't make the form too pedantic.

2) When we cannot avoid it, try to write text questions for the input
controls which allow for the right number of label tags. So, instead of
"Birthdate" we would ask "Birth Month and Year" so we can do "Birth <label
for="blah">month</label> and <label for="blah2">year</label>: <input><input>

3) When we cannot write a text label that allows for more than one label
tag, then we will use the single label tag for the first input and a title
in the input of the subsequent input elements.


Thanks everyone!

-A

Received on Monday, 22 April 2002 09:03:22 UTC