improve CHtml::ajaxSubmitButton to support client validation

View : 
<?= CHtml::ajaxSubmitButton(\Lng::Admin('User', 'Login sb'), ''
    , array(
        'replace'=>'#divLoginForm'
    )); ?>

Controller :
if (T\HTTP::IsAsync()) {//is ajax
	$ajaxOutput = $this->renderPartial('login', array('Model' => $LoginForm), true) . '<script>' . 
\Yii::app()->getClientScript()->scripts[\CClientScript::POS_READY]['CActiveForm#formLogin'] . '</script>';
	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.