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

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

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

or just name="".
#2

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

[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.
Code:
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.
#4

[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?
#5

[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