docs
Loading...
Searching...
No Matches
ValidityState

#include <Ultralight/dom/Element.h>

Overview

The ways a form control fails its constraints (ValidityState).

Get one from HTMLInputElement::validity() (or the textarea and select versions). It's a snapshot, so unlike the web's live ValidityState it doesn't change when the control does.

dom::ValidityState v = input.validity();
input.setCustomValidity("Enter a name");
The ways a form control fails its constraints (ValidityState).
Definition Element.h:2085
bool valueMissing
A required control has no value.
Definition Element.h:2086

Public Attributes

bool valueMissing = false
 A required control has no value.
bool typeMismatch = false
 The value doesn't fit the input type (eg, a bad email).
bool patternMismatch = false
 The value doesn't match the pattern attribute.
bool tooLong = false
 The user made the value longer than maxlength.
bool tooShort = false
 The user made the value shorter than minlength.
bool rangeUnderflow = false
 The value is less than min.
bool rangeOverflow = false
 The value is greater than max.
bool stepMismatch = false
 The value doesn't fit the step attribute.
bool badInput = false
 The user entered something the control can't convert.
bool customError = false
 A custom error message is set.
bool valid = false
 None of the above are true.

Member Data Documentation

◆ badInput

bool badInput = false

The user entered something the control can't convert.

◆ customError

bool customError = false

A custom error message is set.

◆ patternMismatch

bool patternMismatch = false

The value doesn't match the pattern attribute.

◆ rangeOverflow

bool rangeOverflow = false

The value is greater than max.

◆ rangeUnderflow

bool rangeUnderflow = false

The value is less than min.

◆ stepMismatch

bool stepMismatch = false

The value doesn't fit the step attribute.

◆ tooLong

bool tooLong = false

The user made the value longer than maxlength.

◆ tooShort

bool tooShort = false

The user made the value shorter than minlength.

◆ typeMismatch

bool typeMismatch = false

The value doesn't fit the input type (eg, a bad email).

◆ valid

bool valid = false

None of the above are true.

◆ valueMissing

bool valueMissing = false

A required control has no value.


The documentation for this struct was generated from the following file: