Register a callback function for one of the events issued during form validation.
The following events are available:
// Log a console message when the event is triggered
xm_validator.on("start", function(data) { console.log('validate-start', data); });
xm_validator.on("progress", function(data) { console.log('progress', data); });
xm_validator.on("end", function(data) { console.log('validate-end', data) });
Name of the event to listen to.
Callback that is called when the event occurs. The callback receives the index (idx
)
of the form element being validated, a list (items
) of all items to be validated, the current item (item
)
that is being validated, and whether the current item is (valid
).
The main interface for interacting with the form validator. You can use it, for example, to listen to certain events during form validation.