如果我还附加了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' => 'РоссИЮ',
'spanish' => 'Español'
);
$js = 'onChange="this.form.submit()"';
echo form_dropdown('language', $language, 'select', $js);
答案 0 :(得分:1)
将班级添加到$js
变量;
$js = 'onChange="this.form.submit()" class="myClass"';