How to use ajaxSubmitButton

I want use ajaxSubmitButton submit form and alert the return,there is my code:


<?php echo CHtml::ajaxSubmitButton('Publish',array('Post/publishAjax'),array('success'=>'js:alert('aaa')')); ?>


public function actionPublishAjax() {

echo 'sss';


how can i get controller action return show in the popup message box?

thank you very much!

Hi, you can do it this way,

<?php echo CHtml::ajaxSubmitButton('Publish',array('Post/publishAjax'),

       array('success'=>'function(html) { alert(html); }')); ?>

Thank you !