Consider below ASP.Net RadioButtonList control:
<asp:RadioButtonList ID="rbList" runat="Server">
<asp:ListItem Text="Kapil" Value="1" Selected="True">
</asp:RadioButtonList>
You can now get selected radio button value using below javascript:
function GetRadioButtonValue()
{
var id = <%= rbList.ClientID %>;
var radio = document.getElementsByName(id);
for (var i = 0; i < radio.length; i++)
{
if (radio[i].checked)
alert(radio[i].value);
}
}
Its working fine, Thanks a lot.
ReplyDeleteThanks..
ReplyDelete