Emwat Oon Posted June 16, 2014 Share Posted June 16, 2014 (edited) Is there a way to tie a radiobutton into a function? Like onClick? I've looked on msdn, but the closest I found is OnCheckedChanged and that isn't working for me. This is what I've tried. <asp:RadioButton ID="radSpecifyOther" runat="server" GroupName="specify" Text="Other" OnCheckedChanged="radEnableOther" EnableViewState="true"/> protected void radEnableOther(object sender, EventArgs e) { if (radSpecifyOther.Checked) txtEnableSpecify.Enabled = true; else txtEnableSpecify.Enabled = false; } Edited June 16, 2014 by Emwat Oon Link to comment Share on other sites More sharing options...
shaili_shah Posted March 17, 2020 Share Posted March 17, 2020 Yes you can use onclick event as <asp:RadioButton ID="chkNo" Text="No" runat="server" onclick="fn()" /> you can add your own function. After this you can use the JavaScript to define function. <script type="text/javascript"> function fn() { alert("I have clicked no button"); } </script> i hope you will understand. Link to comment Share on other sites More sharing options...
Ingolme Posted March 17, 2020 Share Posted March 17, 2020 Please do not reply to old topics. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now