I have a multiple select-list-box
for Staff
in Create-Service-Form
, used to select multiple staff when creating a new service. for this i can assign multiple staff on a single service.
I saved staff_id
field as:
$model->staff_id = serialize($model->staff_id);
Here the update-view code for multiple-select-list-box:
<div class="row">
<?php echo $form->labelEx($model,'staff_id'); ?>
<?php
$data = array('1' => 'Sam', '2' => 'john', '3' => 'addy');
$htmlOptions = array('size' => '5', 'prompt'=>'Use CTRL to Select Multiple Staff', 'multiple' => 'multiple');
echo $form->ListBox($model,'staff_id', $data, $htmlOptions);
?>
<?php echo $form->error($model,'staff_id'); ?>
</div>
Problem is, when i load form for updating a service. how do i select those staff, which are previously saved in database?
I tried this dropDownList-attributes, but it not working.
$select | string | the selected value
if someone has solution, then suggest me. Thanks All Mates...