CodeIgniter Forums
Cannot assign html id attribute to select objects via form_dropdown() helper method - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Cannot assign html id attribute to select objects via form_dropdown() helper method (/thread-26598.html)



Cannot assign html id attribute to select objects via form_dropdown() helper method - El Forum - 01-18-2010

[eluser]axiom82[/eluser]
Helper Method:
Code:
<? echo form_dropdown('can_assign_id', array(0 => 'No', 1 => 'Yes'), '0', " id=\"213\"" ?>

Result:
Code:
<select name="can_assign_id">
<option value="0" selected="selected">No</option>
<option value="1">Yes</option>
</select> id="213"

Expected Result:
Code:
<select name="can_assign_id" id="213">
<option value="0" selected="selected">No</option>
<option value="1">Yes</option>
</select>

An array with key/value pairs for attributes would be awesome.


Cannot assign html id attribute to select objects via form_dropdown() helper method - El Forum - 01-19-2010

[eluser]axiom82[/eluser]
Strange, the issue fixed itself. You know what that means: user error Smile