WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Forms marked with list elements

for

From: Tim Beadle
Date: Nov 10, 2006 6:20AM


On 08/11/06, Jorge Fernandes < <EMAIL REMOVED> > wrote:
> Recently I found an article that explain the advantages of marked
> forms with list elements. "semantically..." say the author "... a
> form controls in some kind of logical order, is a list".
>
> The author outlined stylistic and accessible (??) advantages of using
> list elements in a form.
>
> About the accessible issue, I'm not so sure, that could be a good
> strategy. What do you think about it?
>
> The article is at:
> http://www.alistapart.com/articles/prettyaccessibleforms

I quote:
"It can be time consuming to make web forms both pretty and
accessible. In particular, laying out forms where the form label and
input are horizontally adjacent, as in the image below, can be a real
problem. We used to use tables, which worked well in this scenariobut
forms don't constitute tabular data, so it's a semantic faux pas."

I use <div><label><input></div> pairs inside fieldsets for form
structure these days, with some CSS to style these in a compact (label
and input side-by-side) or list (label above input) depending on the
class applied to the containing fieldset. I also have special cases
for checkboxes and radio buttons, as these should come before the
associated label for meaningful screen-reader output.

That said, I know there is an argument that tabular data is _exactly_
what forms are, and so tables might be more semantically appropriate
than the ordered list that the author of the article advocates.

No right or wrong answer, but some food for thought.

Tim