Fields are validated on blur. If a field is already invalid, its validity is checked on each key input so that the user gets immediate feedback when the field is again valid.
A required field cannot be left empty.
The pattern
property specifies a regular expression that the element’s value is
checked against.
Valid flight number: 2 uppercase letters followed by 3 or 4 numbers. For example: SA1234
Valid username: Alphanumeric characters, underscores and dots. For example: name.family
Extend Vaadin.TextFieldElement
to create your own custom element,
then override the checkValidity()
method to validate the user’s input.
Valid ID: Use a 10 digit number. The sum of digits must be divisible by 10. For example 1111111111.
Extend Vaadin.TextFieldElement
to create your own custom element,
then override the checkValidity()
to make your asynchronous validation,
and finally set the invalid
flag appropriately in the callback.
Valid username: Must be unique. For example, the username "Kamren" is taken.