Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

adding class and id in form_dropdown

Is there any possible way of adding class and id attributes in form_dropdown of CodeIgniter? I tried form_dropdown('name',$array,'class','id') and it's not changing anything, please tell me how to implement it?

Edited:
with my dropdown form like this form_dropdown('name',$array,set_value('someValue'),'id="myId"'); if I see my source from my browser it's look like this <select name="provinsi" id="provinsi_id">, but if I write like your way form_dropdown('name',$array,set_value('someValue'),'class="myClass"','id="myId"'); than like this in my browser source <select name="provinsi" class="myClass">

that was I mean
thank you

like image 207
ranggadablues Avatar asked Jun 21 '12 07:06

ranggadablues


1 Answers

Like this:

form_dropdown('name', $array, '', 'class="my_class" id="my_id"')

The third parameter is for the value you wish to be selected and the fourth is for the additional data. Read more.

like image 198
Yan Berk Avatar answered Oct 30 '22 05:10

Yan Berk