registerValidator() method
Register a validator
It is used when you want to use a custom validator.
registerValidator(name: String, func: Function): Core
(* denotes a required parameter)
Parameter | Type | Description |
---|
name * | String | The name of validator |
func * | Function | The validator function |
Using in the browser
const fv = FormValidation.formValidation(
document.getElementById('demoForm'),
{
...
}
);
fv.registerValidator(...);
Using with ES6 module
import formValidation from 'formvalidation/dist/es6/core/Core';
const fv = formValidation(
document.getElementById('demoForm'),
{
...
}
);
fv.registerValidator(...);
See also