A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://developer.mozilla.org/zh-CN/docs/Web/API/HTMLFormElement/reportValidity below:

HTMLFormElement.reportValidity() - Web API | MDN

HTMLFormElement.reportValidity()

Baseline Widely available

方法 HTMLFormElement.reportValidity() 返回布尔值,如果 form 表单的子表单控件满足验证限制条件,则该方法返回 true ,否则返回false。当返回 false 时,每个不合法的子控件的 invalid 事件将会被触发,并且验证中存在的问题会报告该用户。

Syntax
HTMLFormElement.reportValidity()
Return value Example
document.forms["myform"].addEventListener(
  "invalid",
  function () {
    // Optional response here
  },
  false,
);

document.forms["myform"].addEventListener(
  "submit",
  function () {
    document.forms["myform"].reportValidity();
  },
  false,
);
Specifications Browser compatibility

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4