Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] form_dropdown() does multipart on its own?
#1

[eluser]ipsod[/eluser]
I'm using CI 2.0 and have this code:
Code:
echo form_dropdown('to', $accounts, $to);

For no apparent reason, this is the output
Code:
<select name="to" multiple="multiple">
<option value="2" selected="selected">Westair</option>
<option value="3">Ebay</option>
<option value="4">R&J Rentals</option>
</select>

. . . multiple="multiple"???
#2

[eluser]Cristian Gilè[/eluser]
$to is an array of multiple items

Code:
count($to) > 1


form_dropdown() accepts four parameters:.
Quote:The first parameter will contain the name of the field, the second parameter will contain an associative array of options, and the third parameter will contain the value you wish to be selected. If you would like the opening <select> to contain additional data, like an id attribute or JavaScript, you can pass it as a string in the fourth parameter


Cristian Gilè
#3

[eluser]ipsod[/eluser]
Thank you, Cristian. I was handing it an array.




Theme © iAndrew 2016 - Forum software by © MyBB