How to enable button and other checkbox on checkbox checked event in Jquery




Aspx:
<asp:CheckBox ID="chkChanges" runat="server" Text=" Change Roles  " />
<asp:Button ID="btnChanges" runat="server" Text="Save Changes"  />

 <asp:CheckBox ID="chkAdd" runat="server" Enabled="false" CssClass="chkaddclass" />


<script type="text/javascript">

        $(function () {
            $('#<%= chkChanges.ClientID  %>').click(function () {
                if ($(this).is(':checked')) {
                    $('#<%= btnChanges.ClientID %>').removeAttr('disabled');
                    $('.chkaddclass :first').removeAttr('disabled');

                }
                else {
                    $('#<%= btnChanges.ClientID %>').attr('disabled', 'disabled');
                    $('.chkaddclass :first').attr('disabled', 'disabled');
                }
            });

        });

    </script>

Comments

Popular posts from this blog

How to retain the data annotations or class during modify a table in the database

Interview Questions

AJAX CONTROL