ajaxSubmitButton success result

Hi

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 …? :

http://www.yiiframework.com/wiki/72/cjuidialog-and-ajaxsubmitbutton/

Hello,

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)

    if(isset($_POST['form')){

           $model->attributes($_POST['form']);

         if($mode->save)

               //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 ";        




}

   else{

     $this->render('form',array('model'=>$model));


}

}



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