mozilla

Revision 236995 of <fieldset>

  • Revision slug: HTML/Element/fieldset
  • Revision title: fieldset
  • Revision id: 236995
  • Created:
  • Creator: ethertank
  • Is current revision? No
  • Comment +ja; 12 words added

Revision Content

Summary

The HTML element fieldset (<fieldset>) is used to group several controls as well as labels ({{ HTMLElement("label") }}) within a web form.

Usage context

Content categories Flow content, sectioning root, listed, form-associated element
Permitted content an optional {{ HTMLElement("legend") }} element, followed by flow content
Tag omission none, both the start tag and the end tag are mandatory
Permitted parent elements any flow element
Normative document HTML5, section 4.10.5 ({{ HTMLVersionInline("4") }} : HTML4.01, section 17)

Attributes

Like all other HTML elements, this element supports the global attributes.

disabled {{ HTMLVersionInline("5") }}
If this Boolean attribute is set, the form controls that are its descendants, except descendants of its first optional {{ HTMLElement("legend") }} element, are disabled, i.e., not editable. They won't received any browsing events, like mouse clicks or focus-related ones. Often browsers display such controls as gray.
form {{ HTMLVersionInline("5") }}
This attribute has the value of the id attribute of the {{ HTMLElement("form") }} element its related to. Its default value is the id of the nearest {{ HTMLElement("form") }} element it is a descendant.
name {{ HTMLVersionInline("5") }}
The name associated with the group, which is submitted with the form data.
The label for the field set is given by the first {{ HTMLElement("legend") }} element that is a child of this field set.

DOM interface

This element implements the DOM HTMLFieldSetElement interface.

Examples

Please see the {{ HTMLElement("form") }} page for examples on <fieldset>.

See also

  • Other form-related elements: {{ HTMLElement("form") }}, {{ HTMLElement("legend") }}, {{ HTMLElement("label") }}, {{ HTMLElement("button") }}, {{ HTMLElement("select") }}, {{ HTMLElement("datalist") }}, {{ HTMLElement("optgroup") }}, {{ HTMLElement("option") }}, {{ HTMLElement("textarea") }}, {{ HTMLElement("keygen") }}, {{ HTMLElement("input") }}, {{ HTMLElement("output") }}, {{ HTMLElement("progress") }} and {{ HTMLElement("meter") }}.
{{ languages( { "es": "es/HTML/Elemento/fieldset", "fr": "fr/HTML/Element/Fieldset", "ja": "ja/HTML/Element/fieldset" } ) }}

Revision Source

<h2>Summary</h2>
<p>The HTML element<em> fieldset </em>(<span style="font-family: Courier New;">&lt;fieldset&gt;</span>) is used to group several controls as well as labels ({{ HTMLElement("label") }}) within a web form.</p>
<h2>Usage context</h2>
<table class="standard-table"> <tbody> <tr> <td>Content categories</td> <td><a href="/en/HTML/Content_categories#Flow_content" title="en/HTML/Content categories#Flow content">Flow content</a>, <a href="/en/Sections_and_Outlines_of_an_HTML5_document#sectioning_root" title="en/Sections and Outlines of an HTML5 document#sectioning root">sectioning root</a>, <a href="/en/HTML/Content_categories#form_listed" title="en/HTML/Content categories#form listed">listed</a>, <a href="/en/HTML/Content_categories#form-associated_content" title="en/HTML/Content categories#form-associated content">form-associated</a> element</td> </tr> <tr> <td>Permitted content</td> <td>an optional {{ HTMLElement("legend") }} element, followed by flow content</td> </tr> <tr> <td>Tag omission</td> <td>none, both the <span title="syntax-start-tag">start tag</span> and the <span title="syntax-end-tag">end tag</span> are mandatory</td> </tr> <tr> <td>Permitted parent elements</td> <td>any flow element</td> </tr> <tr> <td>Normative document</td> <td><a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#the-fieldset-element" title="http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#the-fieldset-element">HTML5, section 4.10.5</a> ({{ HTMLVersionInline("4") }} : <a class="external" href="http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.10" title="http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.10">HTML4.01, section 17</a>)</td> </tr> </tbody>
</table>
<h2>Attributes</h2>
<p>Like all other HTML elements, this element supports the <a href="/en/HTML/Global_attributes" title="en/HTML/Global attributes">global attributes</a>.</p>
<dl> <dt><a name="attr-disabled">disabled</a> {{ HTMLVersionInline("5") }}</dt> <dd>If this Boolean attribute is set, the form controls that are its descendants, except descendants of its first optional {{ HTMLElement("legend") }} element, are disabled, i.e., not editable. They won't received any browsing events, like mouse clicks or focus-related ones. Often browsers display such controls as gray.</dd> <dt><a name="attr-form">form</a> {{ HTMLVersionInline("5") }}</dt> <dd>This attribute has the value of the <strong>id </strong>attribute of the {{ HTMLElement("form") }} element its related to. Its default value is the <strong>id</strong> of the nearest {{ HTMLElement("form") }} element it is a descendant.</dd> <dt><a name="attr-name">name</a> {{ HTMLVersionInline("5") }}</dt> <dd>The name associated with the group, which is submitted with the form data. <div class="note">The label for the field set is given by the first {{ HTMLElement("legend") }} element that is a child of this field set.</div> </dd>
</dl>
<h2>DOM interface</h2>
<p>This element implements the DOM <a href="/en/DOM/HTMLFieldSetElement" title="en/DOM/HTMLFieldSetElement">HTMLFieldSetElement</a> interface.</p>
<h2>Examples</h2>
<p>Please see the {{ HTMLElement("form") }} page for examples on &lt;fieldset&gt;.</p>
<h2>See also</h2>
<ul> <li>Other form-related elements: {{ HTMLElement("form") }}, {{ HTMLElement("legend") }}, {{ HTMLElement("label") }}, {{ HTMLElement("button") }}, {{ HTMLElement("select") }}, {{ HTMLElement("datalist") }}, {{ HTMLElement("optgroup") }}, {{ HTMLElement("option") }}, {{ HTMLElement("textarea") }}, {{ HTMLElement("keygen") }}, {{ HTMLElement("input") }}, {{ HTMLElement("output") }}, {{ HTMLElement("progress") }} and {{ HTMLElement("meter") }}.</li>
</ul> <div>{{ languages( { "es": "es/HTML/Elemento/fieldset", "fr": "fr/HTML/Element/Fieldset", "ja": "ja/HTML/Element/fieldset" } ) }}</div>
Revert to this revision