对于Codeigniter中的一些复选框,使用form_dropdown的多个函数 [英] Multiple functions with form_dropdown for some checked checkboxes in Codeigniter
问题描述
我想在Codeigniter中使用form_dropdown将一些函数应用到多个复选框。我想删除,激活和停用某些选定数据的功能。如何在Codeigniter中编写此代码。有人可以帮助我吗?
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 ?!
推荐答案
您可以定义一些JavaScript函数,然后附加到每个下拉列表。这不是确切的代码, http://codeigniter.com/forums/viewthread/165476/ #792072 ,但它说明了如何将第四个参数传递给form_dropdown,这将允许您添加一个可以执行函数的onChange属性。
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)"');
或者,您可以使用JavaScript将操作绑定到加载的下拉列表。无论哪种方式,你都应该能够以这种方式给每个下拉一个不同的动作。
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.
这篇关于对于Codeigniter中的一些复选框,使用form_dropdown的多个函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!