yiisoft/yii — pull request #738 by hightman (2012-05-22 05:52:32+00:00)
Title: (Fixes issue #203) optimized the AJAX validation of CActiveForm

Two improvements to CActiveForm:

1. When validators of one field can be completely converted to Javascript validator, It will not cause AJAX request to server-side on changing this field.

2. When the AJAX validation request caused by some of fields, It will also send all these attribute names to sever. Therefore, server-side can only validate these fields.

The new ajax validation code will be:

```php
protected function performAjaxValidation($model)
{
if(isset($_POST['ajax']) && $_POST['ajax']==='user-form')
{
$class=get_class($model);
if (isset($_POST['attributes']) && is_array($_POST['attributes'][$class]))
$attributes=$_POST['attributes'][$class];
else
$attributes=null;
echo CActiveForm::validate($model, $attributes);
Yii::app()->end();
}
}
```