Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 720959 of HTMLFieldSetElement

  • Revision slug: Web/API/HTMLFieldSetElement
  • Revision title: HTMLFieldSetElement
  • Revision id: 720959
  • Created:
  • Creator: markg
  • Is current revision? No
  • Comment copyedit

Revision Content

{{ ApiRef() }}
 

The HTMLFieldSetElement interface has special properties and methods (beyond the regular {{domxref("HTMLelement")}} interface it also has available to it by inheritance) for manipulating the layout and presentation of field-set elements.

Properties

Inherits properties from its parent, {{domxref("HTMLElement")}}.

Name Type Description
disabled {{domxref("Boolean")}} Reflects the {{htmlattrxref("disabled", "fieldset")}} HTML attribute, indicating whether the user can interact with the control.
elements {{readonlyInline}} {{domxref("HTMLFormControlsCollection")}} The elements belonging to this field set.
form {{readonlyInline}} {{domxref("HTMLFormElement")}} The containing form element, if this element is in a form.
If the button is not a descendant of a form element, then the attribute can be the ID of any form element in the same document it is related to, or the null value if none matches.
name {{domxref("DOMString")}} Reflects the {{htmlattrxref("name", "fieldset")}} HTML attribute, containing the name of the field set, used for submitting the form.
type {{readonlyInline}} {{domxref("DOMString")}} Must be the string fieldset.
validationMessage {{readonlyInline}} {{domxref("DOMString")}} A localized message that describes the validation constraints that the element does not satisfy (if any). This is the empty string if the element is not a candidate for constraint validation (willValidate is false), or it satisfies its constraints.
validity {{readonlyInline}} {{domxref("ValidityState")}} The validity states that this element is in.
willValidate {{domxref("Boolean")}} Always false because {{HTMLElement("fieldset")}} objects are never candidates for constraint validation.

Methods

Inherits methods from its parent, {{domxref("HTMLElement")}}.

Name & Arguments Return Description
checkValidity() {{domxref("Boolean")}} Always returns true because {{HTMLElement("fieldset")}} objects are never candidates for constraint validation.
setCustomValidity() void Sets a custom validity message for the field set. If this message is not the empty string, then the field set is suffering from a custom validity error, and does not validate.

Specifications

Specification Status Comment
{{SpecName('HTML WHATWG', "forms.html#the-fieldset-element", "HTMLFieldSetElement")}} {{Spec2('HTML WHATWG')}} No change from {{SpecName('HTML5 W3C')}}.
{{SpecName('HTML5.1', "forms.html#the-fieldset-element", "HTMLFieldSetElement")}} {{Spec2('HTML5.1')}}  
{{SpecName('HTML5 W3C', "forms.html#the-fieldset-element", "HTMLFieldSetElement")}} {{Spec2('HTML5 W3C')}} The following properties have been added: disabled, elements, name, type, valdiationMessage, validity, and willValidate.
The following methods have been added: checkValidity(), setCustomValidity().
{{SpecName('DOM2 HTML', 'html.html#ID-7365882', 'HTMLFieldSetElement')}} {{Spec2('DOM2 HTML')}} No change from {{SpecName("DOM1")}}.
{{SpecName('DOM1', 'level-one-html.html#ID-7365882', 'HTMLFieldSetElement')}} {{Spec2('DOM1')}} Initial definition.

Browser compatibility

{{CompatibilityTable}}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support {{CompatVersionUnknown}} {{CompatGeckoDesktop(1.0)}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support {{CompatVersionUnknown}} {{CompatGeckoMobile(1.0)}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}

See also

  • The HTML element implementing this interface: {{ HTMLElement("fieldset") }}.

Revision Source

<div>
 {{ ApiRef() }}</div>
<div>
 &nbsp;</div>
<p>The <code>HTMLFieldSetElement</code> interface has special properties and methods (beyond the regular {{domxref("HTMLelement")}} interface it also has available to it by inheritance) for manipulating the layout and presentation of field-set elements.</p>
<h2 id="Properties">Properties</h2>
<p><em>Inherits properties from its parent, {{domxref("HTMLElement")}}.</em></p>
<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Name</th>
   <th scope="col">Type</th>
   <th scope="col">Description</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td><code>disabled</code></td>
   <td>{{domxref("Boolean")}}</td>
   <td>Reflects the {{htmlattrxref("disabled", "fieldset")}} HTML attribute, indicating whether the user can interact with the control.</td>
  </tr>
  <tr>
   <td><code>elements</code> {{readonlyInline}}</td>
   <td>{{domxref("HTMLFormControlsCollection")}}</td>
   <td>The elements belonging to this field set.</td>
  </tr>
  <tr>
   <td><code>form </code>{{readonlyInline}}</td>
   <td>{{domxref("HTMLFormElement")}}</td>
   <td>The containing form element, if this element is in a form.<br />
    If the button is not a descendant of a form element, then the attribute can be the ID of any form element in the same document it is related to, or the <code>null</code> value if none matches.</td>
  </tr>
  <tr>
   <td><code>name</code></td>
   <td>{{domxref("DOMString")}}</td>
   <td>Reflects the {{htmlattrxref("name", "fieldset")}} HTML attribute, containing the name of the field set, used for submitting the form.</td>
  </tr>
  <tr>
   <td><code>type</code> {{readonlyInline}}</td>
   <td>{{domxref("DOMString")}}</td>
   <td>Must be the string <code>fieldset</code>.</td>
  </tr>
  <tr>
   <td><code>validationMessage</code> {{readonlyInline}}</td>
   <td>{{domxref("DOMString")}}</td>
   <td>A localized message that describes the validation constraints that the element does not satisfy (if any). This is the empty string if the element is not a candidate for constraint validation (<code>willValidate</code> is <code>false</code>), or it satisfies its constraints.</td>
  </tr>
  <tr>
   <td><code>validity</code> {{readonlyInline}}</td>
   <td>{{domxref("ValidityState")}}</td>
   <td>The validity states that this element is in.</td>
  </tr>
  <tr>
   <td><code>willValidate</code></td>
   <td>{{domxref("Boolean")}}</td>
   <td>Always <code>false</code> because {{HTMLElement("fieldset")}} objects are never candidates for constraint validation.</td>
  </tr>
 </tbody>
</table>
<h2 id="Methods">Methods</h2>
<p><em>Inherits methods from its parent, {{domxref("HTMLElement")}}.</em></p>
<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Name &amp; Arguments</th>
   <th scope="col">Return</th>
   <th scope="col">Description</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td><code>checkValidity()</code></td>
   <td>{{domxref("Boolean")}}</td>
   <td>Always returns true because {{HTMLElement("fieldset")}} objects are never candidates for constraint validation.</td>
  </tr>
  <tr>
   <td><code>setCustomValidity()</code></td>
   <td><code>void</code></td>
   <td>Sets a custom validity message for the field set. If this message is not the empty string, then the field set is suffering from a custom validity error, and does not validate.</td>
  </tr>
 </tbody>
</table>
<h2 id="Specifications">Specifications</h2>
<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('HTML WHATWG', "forms.html#the-fieldset-element", "HTMLFieldSetElement")}}</td>
   <td>{{Spec2('HTML WHATWG')}}</td>
   <td>No change from {{SpecName('HTML5 W3C')}}.</td>
  </tr>
  <tr>
   <td>{{SpecName('HTML5.1', "forms.html#the-fieldset-element", "HTMLFieldSetElement")}}</td>
   <td>{{Spec2('HTML5.1')}}</td>
   <td>&nbsp;</td>
  </tr>
  <tr>
   <td>{{SpecName('HTML5 W3C', "forms.html#the-fieldset-element", "HTMLFieldSetElement")}}</td>
   <td>{{Spec2('HTML5 W3C')}}</td>
   <td>The following properties have been added: <code>disabled</code>, <code>elements</code>, <code>name</code>, <code>type</code>, <code>valdiationMessage</code>, <code>validity</code>, and <code>willValidate</code>.<br />
    The following methods have been added: <code>checkValidity()</code>, <code>setCustomValidity()</code>.</td>
  </tr>
  <tr>
   <td>{{SpecName('DOM2 HTML', 'html.html#ID-7365882', 'HTMLFieldSetElement')}}</td>
   <td>{{Spec2('DOM2 HTML')}}</td>
   <td>No change from {{SpecName("DOM1")}}.</td>
  </tr>
  <tr>
   <td>{{SpecName('DOM1', 'level-one-html.html#ID-7365882', 'HTMLFieldSetElement')}}</td>
   <td>{{Spec2('DOM1')}}</td>
   <td>Initial definition.</td>
  </tr>
 </tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{CompatibilityTable}}</p>
<div id="compat-desktop">
 <table class="compat-table">
  <tbody>
   <tr>
    <th>Feature</th>
    <th>Chrome</th>
    <th>Firefox (Gecko)</th>
    <th>Internet Explorer</th>
    <th>Opera</th>
    <th>Safari (WebKit)</th>
   </tr>
   <tr>
    <td>Basic support</td>
    <td>{{CompatVersionUnknown}}</td>
    <td>{{CompatGeckoDesktop(1.0)}}</td>
    <td>{{CompatVersionUnknown}}</td>
    <td>{{CompatVersionUnknown}}</td>
    <td>{{CompatVersionUnknown}}</td>
   </tr>
  </tbody>
 </table>
</div>
<div id="compat-mobile">
 <table class="compat-table">
  <tbody>
   <tr>
    <th>Feature</th>
    <th>Android</th>
    <th>Firefox Mobile (Gecko)</th>
    <th>IE Phone</th>
    <th>Opera Mobile</th>
    <th>Safari Mobile</th>
   </tr>
   <tr>
    <td>Basic support</td>
    <td>{{CompatVersionUnknown}}</td>
    <td>{{CompatGeckoMobile(1.0)}}</td>
    <td>{{CompatVersionUnknown}}</td>
    <td>{{CompatVersionUnknown}}</td>
    <td>{{CompatVersionUnknown}}</td>
   </tr>
  </tbody>
 </table>
</div>
<h2 id="See_also">See also</h2>
<ul>
 <li>The HTML element implementing this interface: {{ HTMLElement("fieldset") }}.</li>
</ul>
Revert to this revision