Q: Textbox enabled or disabled based on radio button I am trying following javascript to enable or disable textboxes based on radio buttons. but it does not seem to work.I am getting error like
 JavaScript runtime error: Unable to get property 'checked' of undefined or null reference
 (function () {
        if (document.getElementById("<%=radioStartBusiness.ClientID%>").checked) {
            document.getElementById("<%=TextBoxReportPostingStartDate.ClientID%>").disabled = true;
            document.getElementById("<%=TextBoxReportBusinessStart.ClientID%>").disabled = false;
        }

        if (document.getElementById("<%=radioStartPosting.ClientID%>").checked) {
            document.getElementById("<%=TextBoxReportPostingStartDate.ClientID%>").disabled = false;
            document.getElementById("<%=TextBoxReportBusinessStart.ClientID%>").disabled = true;
        }
    })();

and one of element in aspx page
<asp:RadioButton ID="radioStartBusiness" text="Start Business Date" AutoPostBack="true"
                                        runat="server" Checked="true" GroupName="StartOrPost" />


A: The error you're getting means that getElementById didn't find a matching element. Try to check in the source code of the loaded page and not your file that you have on the server, if you actually have an element with an ID that matches your ASP variable.
