嗨,我正在使用codeigniter
,我想在multi select box
我的页面上添加一个,
我看到了 codeigniter 用户指南示例,但它所做的是在多选中设置值。
像这样
$options = array(
'small' => 'Small Shirt',
'med' => 'Medium Shirt',
'large' => 'Large Shirt',
'xlarge' => 'Extra Large Shirt',
);
$shirts_on_sale = array('small', 'large');
echo form_dropdown('shirts', $options, $shirts_on_sale);
在这样创建的这个多选框中
<select name="shirts" multiple="multiple">
<option value="small" selected="selected">Small Shirt</option>
<option value="med">Medium Shirt</option>
<option value="large" selected="selected">Large Shirt</option>
<option value="xlarge">Extra Large Shirt</option>
</select>
它必须提供要在 $shirts_on_sale
数组中选择的选项,但在我的情况下,我想创建一个多选但dont want selected options
我试图传递一个空数组。但它不工作
像这样
$array = array();
echo form_dropdown('shirts', $substore_details, $array);
如何创建没有选定项目的多选。请帮忙..............