Check if the value an is empty string
Using with form field
The HTML attributes are used to set the validator options via the Declarative plugin
| || ||String||The error message|
Use with select element
If you want a select element to be required, you have to set
value="" for the option which is treated as empty one:
Using with ES6 module
TipThe MandatoryIcon plugin is useful when you want to display the mandatory icon for required fields
In the following form, user is asked to enter the full name.
When the Declarative plugin is used, the notEmpty validator will be turned on automatically if the input uses HTML 5
ES6 Module Example
The following snippet shows how to use the notEmpty validator with ES6 module:
The following validators might be useful to you.