Welcome Guest, Not a member yet? Register   Sign In
[Solved] Select Form Question
#3

(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">
 
       <label class="col-sm-2" for="input-group"><?php echo $entry_group?></label>
        <div class="col-sm-10">
        <select name="permission_group" class="form-control"> 
            <?php foreach ($permission_names as $permission_name) { ?>
               <?php if ($permission_name['group'] == $permission) { ?>
               <option value="<?php echo $permission_name['group']; ?>" selected="selected"><?php echo $permission_name['group']; ?></option>
               <?php } else { ?>
               <option value="<?php echo $permission_name['group']; ?>"><?php echo $permission_name['group']; ?></option>
                <?php ?>
            <?php ?>
        </select>
        </div>
    </div> 
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply


Messages In This Thread
[Solved] Select Form Question - by wolfgang1983 - 03-24-2015, 06:44 AM
RE: Select Form Question - by CroNiX - 03-24-2015, 07:51 AM
RE: Select Form Question - by wolfgang1983 - 03-24-2015, 08:50 AM
RE: Select Form Question - by CroNiX - 03-24-2015, 09:19 AM



Theme © iAndrew 2016 - Forum software by © MyBB