Welcome Guest, Not a member yet? Register   Sign In
Dropdown helper default id property set
#1

[eluser]Remko Posthuma[/eluser]
The dropdown helper does generate a name property but no id property by default. Is it an option to do this by default instead of using the extra? This will make the dropdownbox usable for JS in the page. I have modded line: 260 of form_helper.php to:
$form = '<select name="'.$name.'" id="'.$name.'"'.$extra.$multiple.">\n";
#2

[eluser]Derek Allard[/eluser]
Welcome to CodeIgniter Remko. This isn't a bug, its the intended use of the helper. The best bet for compatibility is to simply extend it out using your preferred method.
#3

[eluser]Colin Williams[/eluser]
Quote:If you would like the opening <select> to contain additional data, like JavaScript, you can pass it as a string in the fourth parameter

Code:
&lt;?= form_dropdown($name, $opts, NULL, 'id="'. $name .'"');




Theme © iAndrew 2016 - Forum software by © MyBB