I have a radio button in ASP.NET
<asp:RadioButton ID="RadioButton2" Text="Yes" GroupName="rb" Checked="false" runat="server" />
I want to use bootstrap-switch that i got from HERE
I simply want to have the "Switching" effect on my radio buttons, instead of the default circles offered by ASP.NET.
Here is what i did:
1) Added Radio Button on my aspx page. As shown above.
2) used the following script
<script type="text/javascript">
$(document).ready(function () {
$("input:radio").bootstrapSwitch();
$("input:radio").on("click", function () {
console.log("Clicked");
$("input:radio").bootstrapSwitch('toggleState', true);
});
});
</script>
Now the behaviour is as such that If I click on "OFF" option, it slides to "ON"... but if i click on "ON" option it doesn't move back to OFF.
Interestingly, If I click on the Text of radio Button which is "YES", it then toggles.
Any help will be much appreciated.