1

I want to load data depending on checkbox and tried this way.

echo CHtml::activeCheckBox($model,'State',
array('ajax'=>array('url'=>$this->createUrl('ad/AllState'),'type'=>'POST')));

When I checked the checkbox, there are two issues

  1. Checkbox always marked as unchecked.
  2. Wrong value in $_POST.
tereško
  • 58,060
  • 25
  • 98
  • 150
kashan
  • 101
  • 7

1 Answers1

0

Use Firebug or Chrome Console, look at the Network Tab, and inspect the request that is being sent. What exactly is passed in the POST array? By default, the serialized form should be passed with the request.

You might also want to set the uncheckValue so a value is always submitted: http://www.yiiframework.com/doc/api/1.1/CHtml/#activeCheckBox-detail

marcovtwout
  • 5,230
  • 4
  • 36
  • 45