Welcome Guest, Not a member yet? Register   Sign In
Re-populating select from db and validate it?
#12

[eluser]tyuwan[/eluser]
This is what i did for mine, i hope this would help you.


Code:
<label class="desc">Select Category:</label>
<select class="field select small" name="edit_parent">
    <option></option>
    &lt;?php foreach($categories as $cat):?&gt;
    <option value="&lt;?=$cat['id'];?&gt;"&lt;?php if($cat['id'] == $editinfo['parent_id'])
    {
        echo set_select('edit_parent',$cat['id'],TRUE);
    }
    else
    {
        echo set_select('edit_parent',$cat['id']);
    }
    ?&gt;>&lt;?=$cat['title'];?&gt;</option>
    &lt;?php endforeach;?&gt;
</select>


Messages In This Thread
Re-populating select from db and validate it? - by El Forum - 02-01-2009, 08:16 AM
Re-populating select from db and validate it? - by El Forum - 02-01-2009, 08:52 AM
Re-populating select from db and validate it? - by El Forum - 02-01-2009, 12:49 PM
Re-populating select from db and validate it? - by El Forum - 02-01-2009, 01:55 PM
Re-populating select from db and validate it? - by El Forum - 02-01-2009, 02:08 PM
Re-populating select from db and validate it? - by El Forum - 02-01-2009, 02:14 PM
Re-populating select from db and validate it? - by El Forum - 02-01-2009, 04:29 PM
Re-populating select from db and validate it? - by El Forum - 02-01-2009, 07:16 PM
Re-populating select from db and validate it? - by El Forum - 02-01-2009, 07:31 PM
Re-populating select from db and validate it? - by El Forum - 02-03-2009, 08:35 AM
Re-populating select from db and validate it? - by El Forum - 02-03-2009, 08:39 AM
Re-populating select from db and validate it? - by El Forum - 02-09-2009, 12:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB