I want my checkbox list to be checked(selected) in the update form

I am using the same form for create and update a record.

<?php echo $form->checkBoxList($model,‘cat’,CHtml::listData(Category::model()->findAll(array(‘order’=>‘category’)),‘id’,‘category’), array(‘multiple’ => ‘multiple’)); ?>

I can select multiple values by checking the checkboxlist generated by the above method.But Can anyone tell me any method, so that the checked values (those I checked while creating the record)will be automatically checked when a user tries to update the record.

Hi

check below link and press " show " for code

http://yippyii.com/examples/checkboxlist

Thanks