Hi,
I have in a _form, a checkBoxList that I populate with data belonging to the model (in fact more complicate, becauseit is from a MANY_MANY relationship).
<h2>My options</h2>
<?php
$model->options = array(array('id'=>1,'name'=>'blup'),array('id'=>2,'name'=>'blup'));?>
<div id="panel-options">
<?php echo CHtml::activeCheckBoxList(
$model,
'options',
CHtml::listData($model->options,'id','name'),
array(
'template' => '<div class="check-option">{input} {label}</div>',
'separator' => '',
)
);
?>
</div>
My _form should work as well as for Create and for Update as it is intended in Yii.
I’m unable to have (in case of Update action) all the checkboxes checked.
[b]Then correct behavior would be:
Retreiving all possible options, then checked the one which belong to the current model.[/b]
Is there a way to have checked boxes ?
Thanks from a newbie…