How to style timezone_menu() |
Hi;
How can I add a class to the drop down created by timezone_menu()? This doesn't seem right: $this->data['timezones'] = timezone_menu('','form-control'); Thanks
Control styles are done using CSS styles.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
The code does look correct (the timezone function usage). Is there any output displayed?
Hard to know without seeing your timezone_menu() code. Like is it outputting HTML, using the form_dropdown() helper, or what?
But using CI's native form_dropdown(), it would be (just like the docs state) entering the custom id/class/other attributes in the 4th parameter. Code: echo form_dropdown('name_of_dropdown', $dropdown_value_array, $selected_value, 'id="my-id" class="some-class"');
timezone_menu('','form-control'); should generate something like:
Code: <select name="timezones" class="form-control"> So you should be able to apply your desired styles to the form-control class. |
Welcome Guest, Not a member yet? Register Sign In |