aboutsummaryrefslogtreecommitdiff
path: root/files/es/web/api/htmlselectelement/setcustomvalidity/index.html
blob: b5477a5ed0b0f3fa809f3fac1e8e3f63a6286118 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
title: HTMLSelectElement.setCustomValidity()
slug: Web/API/HTMLSelectElement/setCustomValidity
translation_of: Web/API/HTMLSelectElement/setCustomValidity
---
<div>{{ APIRef("HTML DOM") }}</div>

<p>El metodo <code><strong>HTMLSelectElement.setCustomValidity()</strong></code> define el mensaje de validación personalizado para el elemento seleccionado con el mensaje especifico. Usa una string vacia para indicar que ese elemento no tiene error de validación customizado.</p>

<h2 id="Syntax">Syntax</h2>

<pre class="syntaxbox"><em>selectElt</em>.setCustomValidity(<em>string</em>);</pre>

<h3 id="Parameters">Parameters</h3>

<ul>
 <li><code>string</code> is the {{domxref("DOMString")}} containing the error message.</li>
</ul>

<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-setcustomvalidity', 'HTMLSelectElement.setCustomValidity()')}}</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-setcustomvalidity', 'HTMLSelectElement.setCustomValidity()')}}</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>

<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p>

<p>{{Compat("api.HTMLSelectElement.setCustomValidity")}}</p>

<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>