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 685403 of HTMLSelectElement.checkValidity()

  • Revision slug: Web/API/HTMLSelectElement.checkValidity
  • Revision title: HTMLSelectElement.checkValidity()
  • Revision id: 685403
  • Created:
  • Creator: crissdev
  • Is current revision? No
  • Comment HTMLSelectElement.checkValidity is available in IE since version 10. Docs URL: https://msdn.microsoft.com/en-us/library/ie/hh772948(v=vs.85).aspx

Revision Content

{{APIRef}}

The HTMLSelectElement.checkValidity() method checks whether the element has any constraints and whether it satisfies them. If the element fails its constraints, the browser fires a cancelable {{event("invalid")}} event at the element, and the returns false.

Syntax

var result = selectElt.checkValidity();

Specifications

Specification Status Comment
{{SpecName('HTML WHATWG', '#dom-cva-checkvalidity', 'HTMLSelectElement.checkValidity()')}} {{Spec2('HTML WHATWG')}} No change since the latest snapshot, {{SpecName('HTML5 W3C')}}.
{{SpecName('HTML5 W3C', 'forms.html#dom-cva-checkvalidity', 'HTMLSelectElement.checkValidity()')}} {{Spec2('HTML5 W3C')}} Initial definition, snapshot of {{SpecName('HTML WHATWG')}}

Browser compatibility

{{CompatibilityTable}}
Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support {{CompatUnknown}} {{CompatGeckoDesktop(2.0)}} 10 {{CompatUnknown}} {{CompatUnknown}}
Feature Android Chrome Firefox Mobile (Gecko) Firefox OS IE Phone Opera Mobile Safari Mobile
Basic support {{CompatUnknown}} {{CompatUnknown}} {{CompatGeckoMobile(2.0)}} 1.0 {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}

See also

Revision Source

<p>{{APIRef}}</p>
<p>The <code><strong>HTMLSelectElement.checkValidity()</strong></code> method checks whether the element has any constraints and whether it satisfies them. If the element fails its constraints, the browser fires a cancelable {{event("invalid")}} event at the element, and the returns <code>false</code>.</p>
<h2 id="Syntax">Syntax</h2>
<pre class="eval  language-html" data-number="">
<code class="language-html">var <em>result</em> = <em>selectElt</em>.checkValidity();</code></pre>
<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', '#dom-cva-checkvalidity', 'HTMLSelectElement.checkValidity()')}}</td>
   <td>{{Spec2('HTML WHATWG')}}</td>
   <td>No change since the latest snapshot, {{SpecName('HTML5 W3C')}}.</td>
  </tr>
  <tr>
   <td>{{SpecName('HTML5 W3C', 'forms.html#dom-cva-checkvalidity', 'HTMLSelectElement.checkValidity()')}}</td>
   <td>{{Spec2('HTML5 W3C')}}</td>
   <td>Initial definition, snapshot of {{SpecName('HTML WHATWG')}}</td>
  </tr>
 </tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<div>
 {{CompatibilityTable}}</div>
<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>{{CompatUnknown}}</td>
    <td>{{CompatGeckoDesktop(2.0)}}</td>
    <td>10</td>
    <td>{{CompatUnknown}}</td>
    <td>{{CompatUnknown}}</td>
   </tr>
  </tbody>
 </table>
</div>
<div id="compat-mobile">
 <table class="compat-table">
  <tbody>
   <tr>
    <th>Feature</th>
    <th>Android</th>
    <th>Chrome</th>
    <th>Firefox Mobile (Gecko)</th>
    <th>Firefox OS</th>
    <th>IE Phone</th>
    <th>Opera Mobile</th>
    <th>Safari Mobile</th>
   </tr>
   <tr>
    <td>Basic support</td>
    <td>{{CompatUnknown}}</td>
    <td>{{CompatUnknown}}</td>
    <td>{{CompatGeckoMobile(2.0)}}</td>
    <td>1.0</td>
    <td>{{CompatUnknown}}</td>
    <td>{{CompatUnknown}}</td>
    <td>{{CompatUnknown}}</td>
   </tr>
  </tbody>
 </table>
</div>
<h2 id="See_also">See also</h2>
<ul>
 <li><a href="/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation">Form validation.</a></li>
</ul>
Revert to this revision