[thelist] where should form inputs go for valid xhtml?

Jens Brueckmann jens.brueckmann at gmail.com
Thu Aug 10 14:54:56 CDT 2006


> > You may not 'need' one for the visual effect, but I generally recommend
> > approaching HTML not as a tool for creating a visual render in a
> > browser, but as a tool to represent information. Given that approach, it
> > sounds like a <fieldset> tag would be in order.
>
> That's where I'm unsure - doesn't the <form> tag itself serve this
> purpose? If so, adding a <fieldset> inside the <form> would be
> redundant.

Sarah, I would like to make an - admittetly flawed - comparison
between forms and tables. This may lead you in the direction of
understanding why the FIELDSET element is indeed more than redundant
markup.

Consider an HTML table. When well structured this table usually
contains other containers, the THEAD, TFOOT and TBODY elements. They
exist to give structure and meaning to the tabular data.
Now, in XHTML, while THEAD and TFOOT are optional, the TBODY element
is always present in the DOM, the parser infers this element if it is
not present in the markup itsself.

Back to forms, the equivalent of the TABLE element would be the FORM
element and the TBODY element of tables would be the FIELDSET element
which enables you to structure your form. The difference is, FIELDSET
is not inferred, you must explicitly use it.

Now you might understand why the use of FIELDSET elements within forms
is not redundant and why it does make more sense to use this element
instead of DIV or P Elements to structure forms.

Cheers,

jens
-- 
Jens Brueckmann
http://www.yalf.de



More information about the thelist mailing list