Enable and disable div using radiobutton list

here radiolist is a radiobutton list with two values.

<asp:RadioButtonList ID="radiolist" runat="server" onclick="GetRadioButtonListSelectedValue(this);">                                                           
                                                             <asp:ListItem Value="witharn" Selected="True"><b>With EUIN & distributor code</b></asp:ListItem>
                                                            <asp:ListItem Value="Withoutarn"><b>Without distributor code</b></asp:ListItem>                                                          
                                                        </asp:RadioButtonList>
disable or enable panel using javascript
 
  var chk = $("#<%=radiolist.ClientID%>").find(":checked").val();
    function GetRadioButtonListSelectedValue(radioButtonList) {
        for (var i = 0; i < radioButtonList.rows.length; ++i) {
            if (radioButtonList.rows[i].cells[0].firstChild.checked) {
                var chk = radioButtonList.rows[i].cells[0].firstChild.value;
                if (chk == 'witharn') {
                    $("#<%=paneldist.ClientID%>").css("display", "block");
                }
                else {
                    $("#<%=paneldist.ClientID%>").css("display", "none");
                }
            }

        }

    }

here paneldist is a div tag.

Comments

Popular posts from this blog

what is Event Cache table in sharepoint

CAML Query syntax and options in SharePoint

Change anchor link url in sharepoint calender