[eluser]redguy[/eluser]
I noticed that the form_dropdown() function doesn't accept an Array of attributes. I've been trying to add an id attribute to the <select>, but the only way I've been able to do that is by:
Code:
<?=form_dropdown('number_of_answers', $no_answers, $default_no_answers, 'id="number_of_answers" class="select"')?>
Trying to pass an Array doesn't work (obvious if you see check the form_dropdown() code).
So I'm wondering why you can't pass an array of attributes as in form_input(), form_textarea(), form_radio(), etc.
I came to this prolem (well, atleast for me), because my <select> needs an id attribute for my jQuery to work. I don't seem to break anything if I change line 260 of the form_helper() from:
Code:
$form = '<select name="'.$name.'"'.$extra.$multiple.">\n";
to:
Code:
$form = '<select name="'.$name.'" id="'.$name.'"'.$extra.$multiple.">\n";
What is the design decision behind this behaviour? Since it's different than the other form_helper() functions.