The drop-down list always lists all the values ​​in codeigniter

My drop-down list always displays all the values ​​that are all visible every time.

view

<label>Choose Employees</label>
<select name="select_employee[]" multiple="multiple">
    <option disabled="disabled" selected>Select</option>
        <? foreach ($employee->result() as $var) 
            {?> 
                <option value="<?echo $var->emp_id;?>"><?echo $var->emp_name;?></option>
            <?}?>
</select>

This is a constant look. Is this a css problem ..? Deleting an array character has the correct representation ... but I want to save it as an array.

originally vie that way

+4
source share
2 answers

There is multiple="multiple"something in your code that makes all parameters visible, because your user should be able to select more than one option.

Here is the documentation: http://www.w3schools.com/tags/att_select_multiple.asp

0
source

<select name="select_employee[]" multiple="multiple" size="1"> will display two options.

- 1 . , 4

+2

All Articles