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)
ParameterTypeDescription
name*StringThe name of validator
func*FunctionThe 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