我有一个下拉列表一个repeater.And这个下拉列表来在repeater.I每个记录显示里面想应该没有重复的值,从下拉列表上客户端只能选择。我的代码是使用javascript或jquery检测dropdownlist中选择的重复值?
<asp:Repeater ID="rep_hello" runat="server">
<ItemTemplate>
<asp:Label ID="lbl" runat="server" Text=' <%#DataBinder.Eval(Container.DataItem, "batchid")%>'></asp:Label>
<%#DataBinder.Eval(Container.DataItem, "batchid")%><br />
<%#DataBinder.Eval(Container.DataItem, "ts")%><br />
<asp:DropDownList ID="drp_comp" runat="server">
<asp:ListItem Value=""></asp:ListItem>
<asp:ListItem Value="1">1</asp:ListItem>
<asp:ListItem Value="2">2</asp:ListItem>
<asp:ListItem Value="3">3</asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:Repeater>
所以请帮助我..在此先感谢。
检查了这一点http://stackoverflow.com/questions/878852/jquery- add-decimal-to-select-no-duplicates-with-option-to-remove – birkof
先生,这是一些其他情况..我想当任何值在下拉列表中选择,然后它会检查它是否重复,如果是的话显示警告框,这(选定的值)已被选中,请选择另一个。 –
你能否粘贴它吐出的最终HTML,因为它在javascript中是你想要的:) –