Welcome Guest, Not a member yet? Register   Sign In
Dropdown in a form
#4

[eluser]pickupman[/eluser]
Try this:
Code:
$dropdown = array('FALSE' => 'Please Select'); //Create array

foreach($result as $row){
  $dropdown[$row->courseid] = $row->courseid; //Add item to array
}

echo form_dropdown('select',$dropdown); //Print drop down

Make sure that the variable $result is the result object and not a query object. (ie. Somewhere you have passed $result = $some_query->result(); Otherwise, it won't work. Please use the <code> button when posting code into the forums. It will make it easier for people to copy and pasted your code.


Messages In This Thread
Dropdown in a form - by El Forum - 05-02-2010, 02:23 AM
Dropdown in a form - by El Forum - 05-02-2010, 05:45 AM
Dropdown in a form - by El Forum - 05-02-2010, 06:08 AM
Dropdown in a form - by El Forum - 05-02-2010, 09:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB