ep.validate.basic()
Categories: Utilities
ep.validate.basic( value, [ options ] )
Plugin: ep.validate
Description: Basic validate method.
-
ep.validate.basic( value, [ options ] )
version added: 6.11.0value A text to validate
options A map of additional options pass to the method.
The ep.validate.basic()
method is a basic method for validation.
-
Validate a string.
Code:
ep.validate.basic( 'Lorem ipsum ...', { required: true, pattern: '^[\w\.]+$', minlegth: 10, maxlength: 20 });
Results:
true
-
Validate a string with error return.
Code:
ep.validate.basic( 'Lorem ipsum ...', { required: true, pattern: '^[\w\.]+$', minlegth: 10, maxlength: 15 });
Results:
NOT_IN_RANGELENGTH