[thelist] <fieldset> and <legend> vs <h2>

Randal Rust randalrust at gmail.com
Wed Jun 27 07:42:22 CDT 2007


On 6/27/07, Bill Moseley <moseley at hank.org> wrote:

> I tend to use fieldsets with every form, even for forms that have a few
> elements.

Semantically, that is the correct way to do things. Personally, I
found the LEGEND element to be a bit cumbersome, so I started using H3
inside of the FORM. I checked with the WAI group at the W3C and the
feedback I got was basically as long as I had a clear indicator for
the sections of the FORM, it was OK.

In a situation like yours, I do something like this:

<form>
<h2>Basic Information</h2>
<fieldset></fieldset>
</form>

For the sake of consistency, you may want to have a heading before
every FIELDSET, even if it only has one field.

-- 
Randal Rust
R.Squared Communications
www.r2communications.com



More information about the thelist mailing list