开发者

Dropdown list inside a datagrid

I am working with a dropdown list that is inside a datagrid. I am binding data to the dropdown list using a dataset. Here is the use case: I select a particular value in a dropdown list from the next row onwards and I select the same value in the other rows of the dropdown list, which causes a messa开发者_Python百科ge to be displayed.

How do I achieve this by using javascript?


Assuming that each dropdown has a unique ID specified: <select id="dropdown1"> etc:

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜