Welcome Guest, Not a member yet? Register   Sign In
How to add attribute like id in form_dropdown() ?
#1

[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
#2

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

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

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

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




Theme © iAndrew 2016 - Forum software by © MyBB