I have two related fields in a Yii model. They are items_per and items_period.
items_per is an integer that reflects how many items to be processed
I created the following javascript function, which I manually call when changing specific fields. It performs ajax validation on all form elements.
/**
* @author marcovtwout
* Force performing full ajax validation on given form.
* @param Object $form jQuery form object
*/
performFullAjaxValidation = function($form){
var settings = $form.data("settings");
$.each(settings.attributes, function () {
this.status = 2; // force ajax validation
});
$form.data("settings", settings);
// trigger ajax validation
$.fn.yiiactiveform.validate($form, function (data) {
$.each(settings.attributes, function () {
$.fn.yiiactiveform.updateInput(this, data, $form);
});
$.fn.yiiactiveform.updateSummary($form, data);
});
}