off() method

Remove the given handler on particular event
off(event: String, func: Function): Core
(* denotes a required parameter)
ParameterTypeDescription
event*StringThe event name
func*FunctionThe event handler
Using the global script in the browser
const fv = FormValidation.formValidation(
document.getElementById('demoForm'),
{
...
}
);
const invalidFieldHandler = function(field) {
// `field` is name of invalid field
...
};
fv.off('core.field.invalid', invalidFieldHandler);
Using the ES6 module
import { formValidation } from '/path/to/@form-validation/cjs/bundle/popular';
const fv = formValidation(
document.getElementById('demoForm'),
{
...
}
);
const invalidFieldHandler = function(field) {
// `field` is name of invalid field
...
};
fv.off('core.field.invalid', invalidFieldHandler);
Using the npm package
import { formValidation } from '@form-validation/bundle/popular';
const fv = formValidation(
document.getElementById('demoForm'),
{
...
}
);
const invalidFieldHandler = function(field) {
// `field` is name of invalid field
...
};
fv.off('core.field.invalid', invalidFieldHandler);