yiisoft/yii — pull request #3057 by Abbas-Hashemian (2013-11-20 19:56:56+00:00)
Title: improve CHtml::ajaxSubmitButton to support client validation

View :
'#divLoginForm'
)); ?>

Controller :
if (T\HTTP::IsAsync()) {//is ajax
$ajaxOutput = $this->renderPartial('login', array('Model' => $LoginForm), true) . '';
echo $ajaxOutput;
}

Developer can save share and reuse above controller code in a method some where :
Tools::FormActivatorScript($FormID);//form id is formLogin to be used in CActiveForm#formLogin
This way ajaxSubmitButton will support client validation easily.