标签:
参考:http://hechuanzhen.iteye.com/blog/1878886
使用zabbix页面中的多选框
<!DOCTYPE html> <html> <head> <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> <script> $(document).ready(function(){ $("#add").click(function(){ var $options = $(‘#groups_right option:selected‘);//获取当前选中的项 var $remove = $options.remove();//删除下拉列表中选中的项 $remove.appendTo(‘#groups_left‘);//追加给对方 }); $("#remove").click(function(){ var $options = $(‘#groups_left option:selected‘);//获取当前选中的项 var $remove = $options.remove();//删除下拉列表中选中的项 $remove.appendTo(‘#groups_right‘);//追加给对方 }); }); </script> </head> <body> <h4>超级管理员管理</h4> <table border="1"> <tr> <td>目前超管</td> <td></td> <td>可选成员</td> </tr> <tr> <td> <select class="input select" id="groups_left" name="groups_left" size="10" multiple="multiple" style="width: 280px;"> {% for superuser in super_user_list %} <option value={{ superuser.id }}>{{ superuser.username }}</option> {% endfor %} </select> </td> <td> <input class="input formlist" type="button" id="add" name="add" value="<"/> <input class="input formlist" type="button" id="remove" name="remove" value=">"/> </td> <td> <select class="input select" id="groups_right" name="groups_right" size="10" multiple="multiple" style="width: 280px;"> {% for user in unsuper_user_list %} <option value={{ user.id }}>{{ user.username }}</option> {% endfor %} </select> </td> </tr> </table> </body> </html>
标签:
原文地址:http://www.cnblogs.com/jiangxu67/p/5065711.html