Ajax Checkbox Toggle




echo CHtml::checkbox('my_checkbox', false, array(

                              

                                                            'value'=>'on',

                                'ajax' => array(

                                'type'=>'POST',

                                'url'=>'index.php?r=realestate/default/checkboxUpdate',

                                'data'=>"shafi"

                            //    {

                                //   var est_valide=$('#UserEst_valide').is(':checked')?0:1;

                                 //  return 'User[est_valide]='+est_valide;

                                //}",

 //array(

  //'submit'=>'index.php?r=realestate/default/checkboxUpdate',

  //'params'=> array('my_checkbox'=>'1')

//)

))); ?>

// in the controller


public function actionCheckboxUpdate() {

 

     echo "wow success";

}




ajax checkbox toggle works nicely…

super…worked nicely

I tried this without any luck. Is not togleing. Anyone else with this trouble ?