on() method
Listen on particular event
on(event: String, func: Function): Core
(* denotes a required parameter)
| Parameter | Type | Description | 
|---|
| event* | String | The event name | 
| func* | Function | The event handler | 
Using the global script in the browser
const fv = FormValidation.formValidation(
    document.getElementById('demoForm'),
    {
        ...
    }
);
const invalidFieldHandler = function(field) {
    
    ...
};
fv.on('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) {
    
    ...
};
fv.on('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) {
    
    ...
};
fv.on('core.field.invalid', invalidFieldHandler);