在CodeIgniter中向class_dropdown添加类

时间:2011-04-06 17:53:56

标签: codeigniter

如果我还附加了Javascript,如何在CodeIgniter中向form_dropdown添加类。这是我的代码:

$language = array(
                        'select' => 'Select Language',
                        'chinese' => '中文',
                        'english' => 'English',
                        'french' => 'Français',
                        'german' => 'Deutsch',
                        'italian' => 'Italiano',
                        'japanese' => '日本',
                        'korean' => '한국어',
                        'polish' => 'Polska',
                        'portuguese' => 'Português',
                        'russian' => 'Росс&#1048Ю',
                        'spanish' => 'Español'       
                    );

    $js = 'onChange="this.form.submit()"';              
    echo form_dropdown('language', $language, 'select', $js);

1 个答案:

答案 0 :(得分:1)

将班级添加到$js变量;

$js = 'onChange="this.form.submit()" class="myClass"';