I have the following JavaScript to toggle a dropdownlists in a ASP.NET page , which gets called when I click a button. I have like 4-5 dropdownlist/Toggle button pair. Each toggle button toggles the enable/disable property on the associated dropdownlist.
function toggleDisableDropDown(dropDownID) {
var element = document.getElementById(dropDownID); // get the DOM element
if (element) { // element found
element.disabled = !element.disabled; // invert the boolean attribute
}
return false; // prevent default action
}
But one of my dropdownlist needs to do a postback everytime, I pick an item to populate another dropdownlist, What I noticed is that on this postback all of my other dropdownlist which were disabled by javascript(user clicks on the toggle button for these dropdownlist) gets enabled.
What is happening here? and how can I fix it?