2009-11-19 57 views
0

我正在使用數據網格內的下拉列表。我使用數據集將數據綁定到下拉列表。這裏是用例:我從下一行開始在下拉列表中選擇一個特定的值,然後在下拉列表的其他行中選擇相同的值,這會導致顯示一條消息。數據網格內的下拉列表

如何通過使用javascript實現此目的?

回答

0

假設每個下拉列表都指定一個唯一的ID:<select id="dropdown1">等:

var dd1 = document.getElementById('dropdown1'); 
var dd2 = document.getElementById('dropdown2'); 

if(dd1[dd1.selectedIndex].value == dd2[dd2.selectedIndex].value) 
{ 
alert("Dropdown 2 is the same value as dropdown1 !!!"); 
} 
在我的任務
+0

所有下拉列表具有獨特的dropdownlist_ID – srikanth 2009-11-20 06:17:24