registerFilter() method

Register a filter
You can remove the filter by using the deregisterFilter() method.
registerFilter(name: String, func: Function): Core
(* denotes a required parameter)
ParameterTypeDescription
name*StringThe name of filter
func*FunctionThe filter function
Using in the browser
const fv = FormValidation.formValidation(
document.getElementById('demoForm'),
{
...
}
);
fv.registerFilter(...);
Using with ES6 module
import formValidation from 'formvalidation/dist/es6/core/Core';
const fv = formValidation(
document.getElementById('demoForm'),
{
...
}
);
fv.registerFilter(...);