fieldset

FilterElements

<fieldset> ... </fieldset>

Establishes a group of related form controls and labels. fieldset elements are placed within the form element. It is similar to div but is specifically for grouping form fields and inputs. It was introduced to improve form accessibility for users with alternative browsing devices.

Start/End Tags

Required/Required

Specifications

  • HTML 4.01
  • HTML5

disabled

Values: None in HTML. disabled="disabled" in XHTML5.
HTML5 only. Disables the control for user input. It can be altered only via a script. Browsers may display disabled controls differently (grayed out, for example), which could be useful for dimming certain controls until required info is supplied.

form=

Values: id of the form owner
HTML5 only. Explicitly associates the input control with its associated form (its form owner). With this method, the input control does not need to be a child of the form element that applies to it.

name=

Values: text
HTML5 only. Assigns a name to the fieldset.
<form>
<fieldset id="customer">
<ul>
  <li><legend>Customer contact information</legend></li>
  <li><label>Full name <input type="text" name="name"></label></li>
  <li><label>Email Address <input type="text" name="email"></label></li>
  <li><label>State <input type="text" name="state"></label></li>
</ul>
</fieldset>
</form>

Rendered Example

Customer contact information

A 1-pixel border was added with a style rule to make the fieldset area evident.