Welcome Guest, Not a member yet? Register   Sign In
Simple upload problem
#2

[eluser]swanky[/eluser]
You're right, your controller is not getting the value of image_group_name. It's getting the value of image_group_id instead. (You also might want to think about adding some friendly validation to your form.)

If you want to get the value of your image_group_name you'll want to replace this:

Code:
<select style="font-size:11px;" name="image_group_id" >
&lt;?php if (isset($image_groups)): ?&gt;
    &lt;?php foreach($image_groups->result() as $row): ?&gt;
    <option value="&lt;?php echo $row->image_group_id?&gt;">&lt;?php echo $row->image_group_name?&gt;</option>
    &lt;?php endforeach; ?&gt;
&lt;?php endif; ?&gt;
</select>

With this:

Code:
&lt;?php
if (isset($image_groups))
{
    $groups = array();
    foreach($image_groups->result() as $row)
    {
        $groups[$row->image_group_name] = $row->image_group_name;
    }
    echo form_label('Image Group', 'image_group_name'); // not needed, but good for accessible forms
    echo form_dropdown('image_group_name',$groups);
}


Messages In This Thread
Simple upload problem - by El Forum - 08-10-2008, 08:19 AM
Simple upload problem - by El Forum - 08-10-2008, 09:22 AM
Simple upload problem - by El Forum - 08-10-2008, 12:29 PM
Simple upload problem - by El Forum - 08-10-2008, 02:24 PM
Simple upload problem - by El Forum - 08-10-2008, 11:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB