[Solved] Select Form Question - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: CodeIgniter 2.x (https://forum.codeigniter.com/forumdisplay.php?fid=18) +--- Thread: [Solved] Select Form Question (/showthread.php?tid=1595) |
[Solved] Select Form Question - wolfgang1983 - 03-24-2015 On my user form I can select a list of permission groups available. On my user table there is a column where called permission_group and that has permission group user is in. The select form on my view can only currently show what permission names are available. I would like to know how on the select form that can show that users permission_group first. $data['permission'] = $user_info['permission_group']; PHP Code: public function edit() { View Quote:<div class="form-group"> RE: Select Form Question - CroNiX - 03-24-2015 Why not have their current group selected instead of showing it "first" (I'm assuming you mean list their current group as first option in the select)? CI's form helpers do that for you if you set it up. RE: Select Form Question - wolfgang1983 - 03-24-2015 (03-24-2015, 07:51 AM)CroNiX Wrote: Why not have their current group selected instead of showing it "first" (I'm assuming you mean list their current group as first option in the select)? CI's form helpers do that for you if you set it up. If you have a codeigniter better way of doing it would be good. But had a coffee break and then Thought of this PHP Code: <div class="form-group"> RE: Select Form Question - CroNiX - 03-24-2015 http://www.codeigniter.com/user_guide/helpers/form_helper.html See form_dropdown() |