Re: How to be markup LABEL element with two or more fields.

At 2001-08-16T07:05-0400, yuu Morita wrote:-

> Tel. [        ] - [        ] - [        ]
>
> If the markup of this is carried out using LABEL element,
> what does it become?
>
> I want to come to markup in this way as below:
>
> <label for="tel1 tel2 tel3">Tel.</label>
> <input id="tel1">-<input id="tel2">-<input id="tel3">

I'm somewhat ambivalent about the use of multiple fields like this for
what is essentially a single piece of information: it may provide some
useful visual guidance, but on the other hand it is likely to be
distinctly unhelpful in a non-visual environment. (This, incidentally, is
a poor example - there are very few cases where requiring a specific
format for a telephone number is reasonable.) A better approach would be
to use a single field, with either an example entry or an explanatory note
to indicate what is required (where it is not already clear).

As for the markup, there would be little practical gain in allowing a
label to reference multiple controls, since it can only pass focus on to
one of them. IOW, this is just as good (or bad):-

<fieldset>
<legend>Tel.</legend>
<input>-<input>-<input>
</fieldset>


Tim Bagot

Received on Thursday, 16 August 2001 16:51:13 UTC