Logo 
Search:

Asp.net Answers

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds
  Question Asked By: Hayfa Khan   on May 01 In Asp.net Category.

  
Question Answered By: Adalia Fischer   on May 01

you could do this with client-side javascript functions. In your
aspx definition - for each dropdownlist -- add the attribute


onChange="javascript:DeleteFromOtherLists(this.id);"

Then in the HEAD of your aspx, define a javascript function..

<HEAD>
<script language="javascript">
function DeleteFromOtherLists(sSelectedID) {

}
</script>
</HEAD>
...


In your javascript function, determine which drop-down ID is calling the
function & run a loop on the other drop  downs - looking for


document.getElementById("otherDropDownList").options[document.getElementById
("otherDropDownList").selectedIndex] ==

document.getElementById(sSelectedID).options[document.getElementById(sSelect
edID).selectedIndex]

If it's equal - you can set the other dropDownList's option to null - and
that will take it out of the drop down list...


document.getElementById("otherDropDownList").options[document.getElementById
("otherDropDownList").selectedIndex] = null;

Share: 

 
 
Didn't find what you were looking for? Find more on Drop Downs Or get search suggestion and latest updates.


Tagged: