[eluser]PauloBr[/eluser]
I have this in my controller:
Code:
$arr = array();
$query = $this->db->get('table');
foreach($query->result() as $row)
{
$arr[$row->id] = $row->title;
}
And use:
Code:
form_dropdown('select_name', $arr);
I try do this:
Code:
foreach($query->result() as $row)
{
// s for unlocked, n for locked
$bgcolor = ( $row->active == 's' ) ? 'CCFFCC' : 'FFE4E1';
$arr[$row->id . '" style="background-color:#' . $bgcolor] = $row->title;
}
Not so beautiful, but it was almost the expected. Now, if I try use the third parameter for option selected, not work.
Well, thanks for attention. I will try other method for this.