ajaxSubmitButton success result


I’m using ajaxSubmitButton and i want to get results when i click on the button.

suppose i have a button that will submit form and create new row in db.in my controller i echo ‘1’ for success and ‘0’ for failure.

how can i read the result after submiting through ajaxSubmitButton?

Could it help?

or perhaps this …? :



have a controller action that with handle your request from the ajaxSubmitbutton

   public function ActionAjaxSubBtn{

    //your ActiveRecord model 

     $model = new DBmodel(); 


   //ajaxSubmitButton uses POST method (default)




               //you can set flash message or just echo the message directly

               //this message will be display in your ajax options array

               // ajaxSubmitButton('label','#',array('update'=>'#form-update'))

                 echo "your message have been saved successfully";

         else echo "error in message pls re-submit the form ";        






thanks i used the update method instead of success and it works