i want to disable dropdown list in my all web pages till connect button is pressed can any rite a javascript function for me plzzzzzzzzzzzzzzzzz

Recommended Answers

All 3 Replies

<input type="button" value="Disable all DropDownList" onclick="DisableDropDown();"/>
<script language="javascript" type="text/javascript">
function DisableDropDown()
{
   var x = document.getElementsByTagName("select");
   for(var i = 0; i < x.length; i++)
   {
      x[i].disabled = true;
   }
}
</script>

if you need to disable just a few dropdownlist then you have to put a classname to those dropdownlist and create a function to find every element with that classname. well if you know a little bit of jquery or something like that is easier.

thanks but i done it my self

Excellent!!! that is the best part.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.