yiisoft/yii2 — pull request #4559 by Alex-Code (2014-08-01 11:02:30+00:00)
Title: ActiveForm validationComplete callback

Now Yii2 supports deferred validation there was no way to know when validation had completed.

I have form fields across some tabs. If a user clicks the submit button and a field fails validation in a non active tab it's not obvious validation has failed.

With the new callback you could do something like,
```
'validationComplete' => new \yii\web\JsExpression("function(form, data, messages) {
$('a[role=tab]').removeClass('error');
if (!$.isEmptyObject(messages)) {
for (var i in messages) {
var pane = $('#' + i).closest('.tab-pane');
$('a[href=\"#' + pane.attr('id') + '\"]').addClass('error');
}
}
}"),
```
To add a class to the tab which has failed fields to change it's colour etc.