Filed under: web-design
Earlier today I asked for some feedback on twitter on how best to markup multiple inputs in a HTML form that may theoretically/logically share a single label. The most apparent example is a date form with separate inputs for DD/MM/YYYY.
In usual, dependable fashion answers were forthcoming from accessibility stalwarts (if that is the right term) Patrick H. Lauke and Bruce Lawson who offered the following responses respectively:
@cole007 fieldset, legend “date of birth”, hidden labels “day”, “month”, “year”
@cole007 3 separate inputs, each with a unique title, no label, in a fieldset with legend “Date”
These two solutions are perfect for my example of day/month/year, but what about less obvious examples and what about inputs that might have no obvious label or title.
At Net Resources, we are currently working on a search form for a client to query against a database on tartans.
One of the criteria you can search against is ‘slog’ which is to do with the thread count of a particular tartan. In official tartan parlance, a slog comprises of two three letter groups divided by a colon, eg. BGK:WRK. The logical break in the data means that the query input should ideally be broken into two divided with a colon, eg:
<label>Slog <input type="text" size="3" /> : <input type="text" size="3" /></label>
However, these slog fields do not have obvious names that can be applied through a title or hidden label, so my question is this. How best would you mark a form with these two inputs divided by a colon?
What – in your opinion – would be the most accessible, semantic, dogs bollocks approach to marking up this particular part of the form?
Commenting is closed for this article.
bruce – Jun 11, 06:04 PM
patrick h. lauke – Jun 11, 08:39 PM
pixeldiva – Jun 12, 10:10 AM
matijs – Jun 12, 03:12 PM