required
Throws an error when the current value is undefined, null, false, or an empty string.
required(errorMessage?: StringConvertible): this
Parameters
- errorMessage — An optional error message to be used if the validation fails, otherwise the default error message is used
Errors
- This method throws an error if the validation fails
Related
- class ValidationTest staticA class that represents a form validation test, passed to a form validation function.