Welcome Guest, Not a member yet? Register   Sign In
Drop Down List Unable to Pass Value
#8

[eluser]deliriumfolk[/eluser]
Hey, thanks guys for all your feedback. I got it working.
Aken had pointed it out that in my view the select menu has a different name.

What change in here is changing the name of the select to groupId.
Code:
View

User Group: <select name="groupId">
    <option value="" >--Select--</option>
    &lt;?php foreach ($usergroup as $usergroup_item) { ?&gt;
    <option value="&lt;?php echo $usergroup_item['groupId'] ?&gt;">&lt;?php echo $usergroup_item['name'] ?&gt;</option>
    &lt;?php } ?&gt;
</select>

And in here I changed the form_validation to groupId as well.
Code:
Controller

$this->form_validation->set_rules('groupId', 'User Group', 'required');

I believe the following changes allow the correct value from the drop down to pass to the model which is waiting to receive attribute from "groupId".


Messages In This Thread
Drop Down List Unable to Pass Value - by El Forum - 07-04-2012, 09:53 AM
Drop Down List Unable to Pass Value - by El Forum - 07-04-2012, 10:36 AM
Drop Down List Unable to Pass Value - by El Forum - 07-04-2012, 08:33 PM
Drop Down List Unable to Pass Value - by El Forum - 07-04-2012, 08:55 PM
Drop Down List Unable to Pass Value - by El Forum - 07-04-2012, 09:05 PM
Drop Down List Unable to Pass Value - by El Forum - 07-04-2012, 10:18 PM
Drop Down List Unable to Pass Value - by El Forum - 07-04-2012, 10:26 PM
Drop Down List Unable to Pass Value - by El Forum - 07-04-2012, 11:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB