Welcome Guest, Not a member yet? Register   Sign In
id in form_dropdown()

[eluser]Mitja B.[/eluser]
form_dropdown('categoryId', $options)

is it possible to use id in form_dropdown() like
<select name="select1" id="select1">

or just name="".

[eluser]Derek Allard[/eluser]
You could add id through the 4th parameter.
echo form_dropdown('categoryId', $options, 'default', 'id="categoryId");

[eluser]Pascal Kriete[/eluser]
[Edit: Ignore this, beat by the robot - need to learn to refresh]

You can, just pass a string of additional parameters to the function as it's 4th parameter.
echo form_dropdown('shirts', $options, 'large', 'id = "select1"');
What you can't have is an individual id on each option, you would need to extend the helper to achieve that.

[eluser]Mitja B.[/eluser]
Thx for fast reply.

What about to add first parameter of option like <option value="">Select</option>. is this possible to add?

[eluser]Derek Allard[/eluser]
If you're trying to add an id to an <option>, then as Inparo said, that's not possible without modifying the helper.

Theme © iAndrew 2016 - Forum software by © MyBB