tags:

views:

310

answers:

5

I dont know anything about DTD.

http://www.bls.gov/oco/ocos292.htm

See how fieldset is used outside of form on this page and it's cool! I love the style!

+2  A: 

Yes, because the fieldset element is used to group related form fields.

John Topley
I +1ed your answer because it was perfectly acceptable as well, this was a pretty vague question and I was just trying to be funny.
Peter Turner
+5  A: 

No, you don't need a fieldset in a form.

Peter Turner
That's not the question! The question is whether you can use a fieldset element outside of a form element.
John Topley
@John:Actually, there is no question. Atleast not in the post body. And Peter's answer addresses that just fine.
Cerebrus
@Cerebrus: The question is in the title and this answer doesn't answer the question.
GoodEnough
+1  A: 

FIELDSET is a regular block level element and can be used in any place where block level elements are allowed (except in a BUTTON element).

Gumbo
+4  A: 

I think the question and chosen answer in this question are misleading. Whether or not a form has to have a fieldset, and whether or not a fieldset has to be in a form are two different questions with two different answers.

According to the HTML4.01 spec, a fieldset is a valid element inside of a form, but as it is a standard block-level element, it is also acceptable elsewhere: http://www.w3.org/TR/html401/interact/forms.html#h-17.10 http://www.w3.org/TR/html401/sgml/dtd.html#block

I can not, however, imagine a use case where this would be done, unless you are using the fieldset for decorating, which would be incorrect usage.

A form however, does not require a fieldset: http://www.w3.org/TR/html401/interact/forms.html#h-17.3

BigDave
A: 

Ok, if you put a filedsed outside a form the page validates, but I don't see any good reason to do it, and if you read the xhtml 1.0 DTD you find this comment in the fieldset section:

The fieldset element is used to group form fields. Only one legend element should occur in the content and if present should only be preceded by whitespace.

alexmeia