A RetroSearch Logo

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

Search Query:

Showing content from https://webplatform.github.io/docs/dom/HTMLInputElement/validationMessage below:

validationMessage · WebPlatform Docs

validationMessage Summary

Returns the error message that would be displayed if the user submits the form, or an empty string if no error message.

Property of dom/HTMLInputElementdom/HTMLInputElement

Syntax

Note: This property is read-only.

var validationMessage = inputElement.validationMessage;
Return Value

Returns an object of type StringString

The error message that would be displayed if the user submits the form, or an empty string if no error message.

Notes

Returns a string containing the standard or custom error message that would be displayed if the user submitted at this time. If no errors are present or the form would validate, an empty string is returned. The following example has a required field, and if the user types “fun” into it, a custom message is set. Try previewing without anything in the field, then enter values, including the word fun: Note For more code samples, see Form controls part 1 and Form controls part 2: validation on the Windows Internet Explorer sample site.

Related specifications
W3C HTML5
Working Draft
WHATWG HTML
Living Standard
See also Related pages Attributions

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