• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.