CodeIgniter Forums
Preselection not working for dropdown - 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: Preselection not working for dropdown (/thread-45780.html)



Preselection not working for dropdown - El Forum - 10-05-2011

[eluser]zulubanslee[/eluser]
I have a dropdown and here is the code
Code:
echo form_dropdown('selectcategory', $category_array, $selected_category);


$selected_category is outputting the variable I want, the html looks like it should, but the page always loads with the first item selected.

Here is the html
http://imgur.com/mbiNR