Removing Selected Item from Dropdownlist inside Gridview Using Javascript.

Vishalneeraj-24503
Posted by Vishalneeraj-24503 under JavaScript category on | Points: 40 | Views : 314
Write below code:-
<script language="Javascript">
function checkDuplicate(objID)
{
//put total row count in hidden field
iRowCnt = new Number(document.getElementById("hdnRowCount").value);
var iCheckedIndex;
var dropDownVal;

//get selectedvalue in variable
var szSelVal = objID.value;

for(i = 1; i <= iRowCnt; i++)
{
dropDownVal = document.getElementById("gvPack_ctl0" + (i + 1) + "_ddl1").value;

//compare values
if (szSelVal == dropDownVal)
{
alert("Alreay selected");
return false;
}
}
</script>

Comments or Responses

Login to post response