I am disabling a dropdownlist when a button is clicked
function disableDropDown(DropDownID)
{
document.getElementById(DropDownID).disabled = true;
return false; <---------tried with and without this, no luck
}
and a onClick call to
disableDropDown('DropDownID');
I see it disable the dropdown and then immediately there is a postback happening which enables it back. Can someone explain what might be wrong here?
Is an ASP.NET Button control calling it? That’s probably why your page is posting back.
Try just using a regular html input button.
<input type="button" onclick="disableDropDown('DropDownID');" />