CodeIgniter Forums
How to add attribute like id in form_dropdown() ? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: How to add attribute like id in form_dropdown() ? (/showthread.php?tid=3835)



How to add attribute like id in form_dropdown() ? - El Forum - 10-24-2007

[eluser]bijon[/eluser]
i want to create a drop_downlist like :
Quote: <select id="country">
<option value="1">Bangladesh</option>
<option value="2">India</option>
<option value="3">UAE</option>
</select>

i know that it can be done by
Quote:echo form_dropdown('country', $options_array, '1');

But it create the code like
Quote: <select name="country">
<option value="1">Bangladesh</option>
<option value="2">India</option>
<option value="3">UAE</option>
</select>

So how can id in the from_dropdown ?
Thanks
Saidur Rahman
Developer
Right Brain Solution Limited


How to add attribute like id in form_dropdown() ? - El Forum - 10-24-2007

[eluser]sharpe[/eluser]
there is an extra argument of the function echo form_dropdown(’country’, $options_array, ‘1’,'id="select_id"');


How to add attribute like id in form_dropdown() ? - El Forum - 10-24-2007

[eluser]bijon[/eluser]
Thanks for quick help. It works .


How to add attribute like id in form_dropdown() ? - El Forum - 07-03-2008

[eluser]kuanfai[/eluser]
If I still need to include the function for onChange(), how should I code?


How to add attribute like id in form_dropdown() ? - El Forum - 07-03-2008

[eluser]sharpe[/eluser]
form_dropdown(’country’, $options_array, ‘1’,’id="select_id" onchange="alert(3)"’)