This is a migrated thread and some comments may be shown as answers.

Enable RadButton

1 Answer 253 Views
Button
This is a migrated thread and some comments may be shown as answers.
Antony
Top achievements
Rank 1
Antony asked on 13 May 2013, 02:50 AM
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

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 13 May 2013, 04:10 AM
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.
Tags
Button
Asked by
Antony
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or