I need listbox of multiple selection in yii, i have code of form area but its saving to database as a word "Array" in field, How to handle this problem?
how to get back while view and update and grid view also
<?php echo $form->dropDownList($model,'clients',
CHtml::listData(client::model()->findAll(array('order'=>'id')), 'id', 'name'),
array('empty'=>'','multiple'=>'multiple','style'=>'width:400px;','size'=>'10'));
?>
Thank you.
For me works this:
'multiple'=>true
Your code must be something like that:
<?php echo $form->dropDownList($model,'clients',
CHtml::listData(client::model()->findAll(array('order'=>'id')), 'id', 'name'),
array('empty'=>'','multiple'=>true ,'style'=>'width:400px;','size'=>'10'));
?>