Welcome Guest, Not a member yet? Register   Sign In
How do you add a class to a form dropdown?
#1

[eluser]Wonder Woman[/eluser]
I have a dropdown with lots of options but was just wondering how I add a class to it?

Code:
$property_type = array(
   '0' => 'Any',
   '1' => 'Flats / Apartments',
   '2' => 'Terraced',
   '3' => 'Semi-detatched',
   '4' => 'Detatched',
   '5' => 'All Houses'
);

How do I put:

Code:
class => 'property'


into:

Code:
form_label('Property Type:', 'property_type').' '.form_dropdown('property_type', $property_type);

Thanks
#2

[eluser]Maglok[/eluser]
http://ellislab.com/codeigniter/user-gui...elper.html

4th parameter. Wink Just create it kinda like this:

Code:
form_dropdown('name', $options, 'default', 'class="property"');

Though your question could also mean you want to add a class to the options of the dropdown, in which case I have no idea. Tongue
#3

[eluser]Wonder Woman[/eluser]
That's exactly what I was after! Brilliant, thank you! Smile




Theme © iAndrew 2016 - Forum software by © MyBB