Style on select option form - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Style on select option form (/showthread.php?tid=7441) |
Style on select option form - El Forum - 04-09-2008 [eluser]PauloBr[/eluser] Can I apply any style on select option to produce something like this? Code: <select name="frm_select"> Currently, I'm use form_dropdown function from helper form. Thanks, Paulo. Style on select option form - El Forum - 04-09-2008 [eluser]xwero[/eluser] I think you better add an id attribute to the select an do the option styling using the id. Code: // view Style on select option form - El Forum - 04-09-2008 [eluser]PauloBr[/eluser] Thanks for reply. But I need individual style, for example: Code: <select name="frm_select"> When green option is unlock and red option is lock, for anything. This options and information from lock or unlock, I have on my database. Thanks, Paulo. Style on select option form - El Forum - 04-09-2008 [eluser]xwero[/eluser] You would have some value to define which option is locked or unlocked. I don't think you can't use form_dropdown in your case. Style on select option form - El Forum - 04-09-2008 [eluser]PauloBr[/eluser] I have this in my controller: Code: $arr = array(); And use: Code: form_dropdown('select_name', $arr); I try do this: Code: foreach($query->result() as $row) 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. Style on select option form - El Forum - 04-09-2008 [eluser]xwero[/eluser] Nice hacking skills I would do it as follows Code: // controller I like to see as much html code as possible in the view files and separate the css from the html with ids an classes. |