CodeIgniter Forums
Need Help - 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: Need Help (/showthread.php?tid=41345)



Need Help - El Forum - 05-05-2011

[eluser]phpfresher[/eluser]
Here is the sample of my drop down select box:
<?php
echo form_dropdown('module_id',$list_of_module,'1',$attribute);
?>
Problem: i need to add the id field in the select box
Here is the sample output that i need:
<select name="module_id" id="module_id">
........


Need Help - El Forum - 05-05-2011

[eluser]MathBoon[/eluser]
Code:
function form_dropdown($name = '', $options = array(), $selected = array(), $extra = '')
//$extra is extra html code

Seems like you're already doing it, so where's you problem?

Code:
echo form_dropdown(‘module_id’,$list_of_module,‘1’,$attribute);

$attribute is your extra html code, put "id='module_id'" in there.