Yii Ajax button for confirm and before sending text

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” …

// paste it on the controller class

public function actionResetPassword($user_id)
// additional code can be here


// 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.
'beforeSend' => 'function() {
$("#resetPass").html("please wait......");
'complete' => 'function() {

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

echo "

" ?>

Happy Coding !!!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s