tags:

views:

27

answers:

1

Hi

I am working in dropdown list that is inside a datagird i am binding data to the dropdown list using dataset. My question is if i select a particular value in a dropdown list from next row onwards if i select the same value in the another rows of dropdown list then it will display a message

how to achieve this by using java script

A: 

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 !!!");
}
Jamie Dixon
in my task all dropdownlist have unique dropdownlist_ID
srikanth