【发布时间】:2017-04-22 16:01:40
【问题描述】:
如果我在同一页面中使用相扑选择和 2 个列表框,我如何识别单击“确定”按钮的列表实例。
以下是我的完整代码: 以下是我的完整代码:
<script
src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js">
</script>
<script src="jquery.sumoselect.min.js"></script>
<link href="sumoselect.css" rel="stylesheet" />
<script type="text/javascript">
$(document).ready(function () {
$(<%=ListBox1.ClientID%>).SumoSelect({ selectAll: true, okCancelInMulti:
true });
$(<%=ListBox2.ClientID%>).SumoSelect({ selectAll: true, okCancelInMulti:
true });
$('.btnOk').on('click', function ()
{
alert('OK button Clicked'); });
});
</script>
<body>
<form id="form1" runat="server">
<div>
</div>
<asp:ListBox runat="server" ID="lstBoxTest1" SelectionMode="Multiple">
<asp:ListItem Text="Red" Value="0"></asp:ListItem>
<asp:ListItem Text="Green" Value="1"></asp:ListItem>
<asp:ListItem Text="Yellow" Value="2"></asp:ListItem>
<asp:ListItem Text="Blue" Value="3"></asp:ListItem>
<asp:ListItem Text="Black" Value="4"></asp:ListItem>
</asp:ListBox>
<asp:ListBox runat="server" ID="lstBoxTest2" SelectionMode="Multiple">
<asp:ListItem Text="Merc" Value="0"></asp:ListItem>
<asp:ListItem Text="Audi" Value="1"></asp:ListItem>
<asp:ListItem Text="Jaguar" Value="2"></asp:ListItem>
<asp:ListItem Text="Porsche" Value="3"></asp:ListItem>
<asp:ListItem Text="Toyota " Value="4"></asp:ListItem>
</asp:ListBox>
</form>
</body>
【问题讨论】:
-
你能告诉我们
form代码吗? -
在上面添加了完整的代码
标签: jquery