Enable RadButton

2 posts, 0 answers
  1. Antony
    Antony avatar
    32 posts
    Member since:
    Feb 2013

    Posted 12 May 2013 Link to this post

    Hi Telerik,

    My registration page contain a RadButton which is initially disabled. On checking an asp checkbox I want to enable this button. How to do it using Javascript?

    Thanks,
    Antony
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 12 May 2013 Link to this post

    Hi Antony,

    Please have a look at the sample code I tried which works fine at my end as expected.

    ASPX:

    <asp:CheckBox ID="chk" runat="server" Text="I accept the License Agreement" onclick="javascript:check();" />
    <telerik:RadButton ID="RadButton1" runat="server" Text="Register" Enabled="false">
    </telerik:RadButton>

    JavaScript:

    <script type="text/javascript">
        function check() {
            var checkBox1 = document.getElementById('<%=chk.ClientID %>');
            var radButton1 = $find('<%=RadButton1.ClientID %>');
            if (checkBox1.checked == true) {
                radButton1.set_enabled(true);
            }
            else {
                radButton1.set_enabled(false);
            }
        }
    </script>

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top