I want to apply some functions to multiple checked checkboxes using form_dropdown in Codeigniter. I want to have delete, activate and deactivate functions for some selected data. How can I write this code in Codeigniter. Can somebody help me ?!
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You could define some JavaScript functions that you then attach to each of your dropdowns. This isn't the exact code, http://codeigniter.com/forums/viewthread/165476/#792072 but it illustrates how you can pass a fourth parameter to form_dropdown, which would let you add an onChange attribute that could execute a function.
form_dropdown('field_name', $options, $selected, 'onchange="doSomething(this)"');
Alternatively, you could use JavaScript to bound the action to the drop downs on load. Either way, you should be able to give each drop down a different action this way.