How to disable a radiobuttonlist using Java Script in Asp.net?

racer

New Member
I have created a web form in which I have take certain fields like Name, Age and two radio button list (Required and ID). I want to enable disable certain fields on the value of one radiobutton list "Required". The "Required" Radiobuttonlist has two items, "YES", "NO". If I select yes, then certain fields should get enabled disabled and vice versa.I am able to disable the texboxes, however I am not able to disable a radiobutton list "ID" which has to list items in it as taxId and PAN. I have used the following code for it\[code\]function EnableDisableID() { if (document.getElementById("<%=rdID.ClientID %>") != null) { var IDList = document.getElementById('<%= rdID.ClientID %>'); var isOpenID; if (IDList != null) { var openSubID = IDList.getElementsByTagName("input"); for (var i = 0; i < openSubID.length; i++) { if (openSubID.checked) { openSubID = openSubID.value; } } } if (openSubID == 'true') { document.getElementById('<%=fbo1RadioButtonList.ClientID %>').disabled = false; document.getElementById('<%=txtFbo1TaxId.ClientID %>').disabled = false; } if (isOpenSubAccount == 'false') { alert("Printing..." + isOpenSubAccount); document.getElementById('<%=fbo1RadioButtonList.ClientID %>').disabled = true; document.getElementById('<%=txtFbo1TaxId.ClientID %>').disabled = true; } } }\[/code\]I am able to disable the FBO1TaxId, however, I am not able to disable the radiobutton list "fbo1RadioButtonList". How will I achieve it. do I have to treat its value individually?
 
Back
Top