code | type | title | description |
---|---|---|---|
true |
page |
validate | Framework | Core |
BaseValidationType class validate() abstract method |
Validates a field against this implemented data type.
This is an abstract method. If not overloaded, it always returns true
validate(opts: JSONObject, field: any, errors: string[]): boolean;
Arguments | Type | Description |
---|---|---|
opts |
JSONObject |
Data type options. The provided object can only contain the keys defined in the allowedTypeOptions property |
field |
any |
Data to validate |
errors |
string[] |
If the provided field is not valid, the reason must be pushed in that array |
The validate
function returns a boolean telling whether the field is valid.