views:

229

answers:

6

I was recently corrected, and according to the HTML4 DTD, it is legitimate to use a fieldset outside of a form: http://www.w3.org/TR/html401/sgml/dtd.html#block

Previously I had not known this, and wonder if anyone can think of a legitimate use case for doing so. I feel like using one to decorate would be frowned upon by most designers. So is there a legitimate use case, or can you link to a site where this has been found appropriate and used as such?

+2  A: 

I think its more than legit to use it for decoration. Its simple and elegant and with the use of tag its pretty nice.

Check w3schools example out

ChrisAD
Yes, but that example is inside a form too. :)
BobbyShaftoe
yea but it looks good even if you dont use it for forms. Put in some info instead of input fields and its all good imho =)
ChrisAD
A: 

Well, using it to decorate can be frowned upon by designers AND be legitimate, so there is a legitimate use case.

BobbyShaftoe
A: 

A form is simply a container for the fields you wish to submit via post back. Most regular site pages may not even have one. That said, using a fieldset as a styling tag is legitimate and has nothing at all to do with whether a form tag exists or not.

Chris Lively
+4  A: 

I used a field set to decorate sections when printing documents. For example an invoice might have a Bill To and a Ship To, and drawing the frame around them with the legend text embeded in the frame can look really slick.

JoshBerke
+1  A: 

I don't think there is a legitimate case to semantically have a fieldset outside a form element, since a fieldset is a set of (input) fields - the clue's in the name! If you have input fields, you will likely always have a form, even if you're not posting back to the server.

I have occasionally used from a presentational aspect, because the fieldset+legend combo is impossible to replicate exactly in CSS, specifically, the broken line behind the legend.

DisgruntledGoat
A: 

It is acceptable to use all form field control outside of a form element, including fieldset.

This is appropriate wherever you have fields that only talk to JavaScript, instead of ever being submitted back as to the server side.

(This didn't originally used to work in Netscape 4, but that's hardly a concern this century...)

bobince