Wait for the validation of the attribute (clientside)


I’m trying to validate some attributes and then execute some action. The problem is that the validation of validateAttribute of yii.activeForm is async. I tried some deferred and promises from jquery without success.

The code which needs to be performed sync:

for (var key in values) {

  $('form').yiiActiveForm('validateAttribute', key);