blob: a37ba5229c3acef9280992bd44585eb0d63ee53c (
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
|
---
title: HTMLFormElement.reportValidity()
slug: Web/API/HTMLFormElement/reportValidity
tags:
- HTML
- HTMLFormElement
- Method
- Reference
browser-compat: api.HTMLFormElement.reportValidity
translation_of: Web/API/HTMLFormElement/reportValidity
---
<div>{{APIRef("HTML DOM")}}</div>
<p><strong><code>HTMLFormElement.reportValidity()</code></strong> メソッドは、この要素の子コントロールが制約の検証を満たしていれば <code>true</code> を返します。
<code>false</code> が返された場合、キャンセル可能な
<code><a href="/ja/docs/Web/API/HTMLInputElement/invalid_event">invalid</a></code> イベントが無効な子それぞれについて発行され、ユーザーに検証の問題を報告します。</p>
<h2 id="Syntax">構文</h2>
<pre class="brush: js"><em>HTMLFormElement</em>.reportValidity()
</pre>
<h3 id="Return_value">返値</h3>
<p><code>true</code> または <code>false</code></p>
<h2 id="Example">例</h2>
<pre class="brush: js">document.forms['myform'].addEventListener('submit', function() {
document.forms['myform'].reportValidity();
}, false);</pre>
<h2 id="Specifications">仕様書</h2>
{{Specifications}}
<h2 id="Browser_compatibility">ブラウザーの互換性</h2>
<p>{{Compat}}</p>
|