Take the 2-minute tour ×
User Experience Stack Exchange is a question and answer site for user experience researchers and experts. It's 100% free, no registration required.

I'm wondering what the suggested usage of <fieldset>s are on a webpage.

For example, on a simple page with just one form (one set of inputs) is it still recommended to use a fieldset? Or should it only be used when there are several forms or several 'sections' on a page ?

Should it only be used on input/edit pages and not display/details pages?

How does including / excluding a fieldset on a page affect usability?

share|improve this question
1  
The first part of your question is probably best asked on StackOverflow or Doctype, where you'll get a better answer. The second part is great for UI though! :) –  Rahul Sep 3 '10 at 18:56

2 Answers 2

up vote 9 down vote accepted

The W3C's HTML Techniques for Web Content Accessibility Guidelines 1.0 notes fieldset as a tag you can use to semantically group fields in a form. You can then label that fieldset with a legend. Depending on how the browser accessing your content works, this could increase accessibility (for instance, a screen reader could indicate that the following section of the form is for alternate shipping addresses, and that would let the visitor know they could possibly skip that section).

You can use a fieldset whenever you want, even if you only have one field. It depends on how you want to semantically describe your content and how concerned you are with making your forms accessible. For instance, a search form containing an input field and submit button could be contained within a fieldset and use a legend, but you could use CSS to hide both and display the form however you want. It's up to you how you want to denote that, including whether you want to use it for input/edit pages or display/details pages.

share|improve this answer

Rahul is correct, though in your example of multiple groups of elements, I'd say it was a must.

A big thing for me is that using a legend with the fieldset adds accessibility for knowledgable users who use "Form mode". If you're providing further information relating to a question in a text or heading it's not "read" in "Form mode" of most readers, but is if you use the legend with the fieldset. It's read as context.

share|improve this answer
1  
It's "Rahul", but I'll forgive you ;-) –  Rahul Sep 3 '10 at 20:46
    
Sorry about that - I'm a poor typer. –  Susan R Sep 4 '10 at 14:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.