Click here to Skip to main content
15,889,335 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All

I want to disable 'select' element,on Onselectedindexchanged of a dropdown..how to write a code in C# OR jAVASCRIPT??
Posted

If you don't want the user to select items from within a dropdown, just disable it.
 
Share this answer
 
Try
XML
<script type="text/javascript">
function makeDisable(){
    var x=document.getElementById("mySelect")
    x.disabled=true
}


for more reference and getting practical influence have a go there-[Disable and enable a dropdown list][^]
 
Share this answer
 
you can write Javascript. call following function on onchange of select element

JavaScript
function disabledME()
{
  if(document.getElementById("Select1").value == "this")
    document.getElementById("Select1").disabled = true;
}


above code will disabled your select element on selected index changed.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900