Reputation: 2331
Is there any way to get errors after ajax validation in js? I need to create some custom modals with errors info. So i think i need some sort of callback function...
Any weird options, like binding submit event on form works bad, i can't get info about filling required fields, for example.
Upvotes: 0
Views: 2459
Reputation: 21
You can use ActiveForm JavaScript API.
Example:
$('#form').on('afterValidate', function (event, fields, errors) {
if (errors.length > 0) {
alert('Errors exists');
}
});
Upvotes: 2