Welcome Guest, Not a member yet? Register   Sign In
form_dropdown allowing to select only one item
#5

[eluser]Syllean[/eluser]
I misunderstood your question, I thought you wanted to be able to return multiple values.

Quote:You can also pass an array of multiple items through the third parameter, and CodeIgniter will create a multiple select for you.

Your problem is here:
Code:
set_value('companyUID', $companies)

The first parameter of set_value() is the field name, the second is your default value (selected) and you're passing an array so it makes a multiple select.

Quote:set_value()

Permits you to set the value of an input form or textarea. You must supply the field name via the first parameter of the function. The second (optional) parameter allows you to set a default value for the form. Example:

<input type="text" name="quantity" value="<?php echo set_value('quantity', '0'); ?>" size="50" />
The above form will show "0" when loaded for the first time.



Messages In This Thread
form_dropdown allowing to select only one item - by El Forum - 07-11-2013, 06:40 AM
form_dropdown allowing to select only one item - by El Forum - 07-11-2013, 06:50 AM
form_dropdown allowing to select only one item - by El Forum - 07-11-2013, 06:56 AM
form_dropdown allowing to select only one item - by El Forum - 07-11-2013, 07:18 AM
form_dropdown allowing to select only one item - by El Forum - 07-11-2013, 07:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB