Yii Ajax button for confirm and before sending text

Hi,
i am back again. today um gonna show you how to make a button for cofirm or before sending text effect in AJAX in the Yii application. you need to write code in only two section which is “controller” and the “view” …
<!–?php

// paste it on the controller class

public function actionResetPassword($user_id)
{
if(Yii::app()->request->isAjaxRequest)
{
// additional code can be here
Yii::app()->end();
}

}

// and paste it in the View

echo "
";
echo CHtml::ajaxButton('Reset Password', // the link body (it will NOT be HTML-encoded.)
array('resetPassword','id'=>$model->user_id), // this is the URL for the request of AJAX . If this is not nonempty, it will be thinking as current url.
array(
'update'=>'#_loading',
'beforeSend' => 'function() {
$("#resetPass").html("please wait......");
}',
'complete' => 'function() {
$("#resetPass").hide();
}',
),

array(
'class'=>'btn btn-info',
'confirm'=>Yii::t('admin','Are you want to Reset Password ?'),
)
);

echo "

" ?>

Happy Coding !!!