【发布时间】:2016-08-16 21:35:06
【问题描述】:
我在 gridview(html 中的表格)中有下拉菜单(在 html 中选择)。这个网格视图有多行。我的目标是不允许用户在下拉列表中选择相同的项目。
例如,如果用户选择纽约
分配房间
usernamedropdown roomnumber
john 1
john (this is wrong) 2
我想处理每个下拉列表的 onchange 并循环遍历网格中的所有值,以及是否有任何下拉值通过错误与所选值匹配。
我尝试了什么
<asp:Gridview id="grdtest" runat="server">
<asp:dropwnlist id="testid" runat="server" onchange =" checkforvalue(this);">
</asp:Gridview>
JS
function checkforvalue()
{
var valuetocheck= $(testid).selectedvalue;
i am stuck here
// loop through all rows in gridview\table and find all the value of dropdown and test .
}
【问题讨论】:
标签: javascript jquery asp.net