How to enable disable fields using Java Script in Webform
<p>I have created a web page "Default.aspx" in which I have taken fields: 
First Name, Last Name, Account Titling, Titling(radio button list), AccountNumber and AccountFormat
under the "Default.aspx" page, I have used a radio button list also, whose values are Yes and No. If I choose Yes, then the following fields visibility should set to false:</p>

<p>First Name, Last Name</p>

<p>If I choose "NO", then the following fields visibility should set to true:</p>

<p>Account Titling, Account number</p>

<p>For this, I have written the below Java Script code in "Default.aspx"</p>

<pre><code>function EnableDisableTaxID() {
        if (document.getElementById("&lt;%=rdOpeningSubAccount.ClientID %&gt;") != null) {

            var openSubAccountList = document.getElementById('&lt;%= rdOpeningSubAccount.ClientID  %&gt;');
            var fbo1RadioList = document.getElementById('&lt;%=fbo1RadioButtonList.ClientID %&gt;').value;
            var isOpenSubAccount;

            if (openSubAccountList != null) {

                var openSubAccount = openSubAccountList.getElementsByTagName("input");

                for (var i = 0; i &lt; openSubAccount.length; i++) {

                    if (openSubAccount[i].checked) {

                        isOpenSubAccount = openSubAccount[i].value;
                        alert("Print" + isOpenSubAccount);
                    }
                }
            }
            alert(typeof(isOpenSubAccount));
            if (isOpenSubAccount == 'true') {
                FirstName.visible = true;
                LastName.visible = false;
                AccountTitling.visible = true;
                lblFirstName.visible=false;
                lblLastName.visible=false;

            }
            else if (isOpenSubAccount == 'false') {
                AccountTitling.visible = true;
                AccountNumber.visible = false;
                lblAccountTitling.visible = true;
                lblAccountNumber.visible = false;
            }
        }
    }
</code></pre>

<p>However, I am getting the required value from the Radio button list, however, when I go to check if the selected value of the radiobuttonlist is true, then the code above does not work. I dont know what am I missing. I know that directly using the below code will not work:</p>

<pre><code>if (isOpenSubAccount == 'true') {
                FirstName.visible = true;
                LastName.visible = false;
                AccountTitling.visible = true;
                lblFirstName.visible=false;
                lblLastName.visible=false;

            }
</code></pre>

<p>Please help as I m stuck here...</p>
