文件见附件:
使用方法:
1、前台代码
<%--下拉列表 --%> <link href="../Styles/jquery-ui.css" rel="stylesheet" type="text/css" /> <link href="../Styles/jquery.multiselect.css" rel="stylesheet" type="text/css" /> <script src="../Scripts/jquery.1.7.2.min.js" type="text/javascript"></script> <script src="../Scripts/jquery-ui.min.js" type="text/javascript"></script> <script src="../Scripts/jquery.multiselect.js" type="text/javascript"></script> <script type="text/javascript"> $(function () { //立项状态 $("#ddlStatus").multiselect({ header: false, height: 200, minWidth: 100, selectedList: 10, //预设值最多显示10被选中项 hide: ["explode", 200], noneSelectedText: '请选择', close: function () { var values = $("#ddlStatus").val(); $("#hdStatus").val(values); } }); //审核状态 $("#ddlEmailVerifyStatus").multiselect({ header: false, height: 200, minWidth: 100, selectedList: 10, //预设值最多显示10被选中项 hide: ["explode", 200], noneSelectedText: '请选择', close: function () { var values = $("#ddlEmailVerifyStatus").val(); $("#hdEmailVerifyStatus").val(values); } }); }); </script>
<tr> <td align="right"> 立项状态: </td> <td> <asp:ListBox ID="ddlStatus" runat="server" SelectionMode="Multiple" multiple="multiple" style="200px"> </asp:ListBox> <input type="hidden" id="hdStatus" runat="server" /> </td> </tr> <tr> <td align="right"> 审核状态: </td> <td> <asp:ListBox ID="ddlEmailVerifyStatus" runat="server" SelectionMode="Multiple" multiple="multiple" style="200px"> </asp:ListBox> <input type="hidden" id="hdEmailVerifyStatus" runat="server" /> </td> </tr>
后台直接使用hd的值,值比如为001,002,003