Thursday, 20 March 2014

radiobuttonlist checked in jquery

first need to read the Radio button and then read the checked value of radio button.
In code snippet showing the radiobutton value into alert message box, Event will fire whn click on hyperlink button

@Code Snippet for radiobuttonlist checked in jquery

<html xmlns="">
<head runat="server">
    <title>Check for radio button</title>
    <script type="text/javascript">
        function getvalue() {
            alert($('#<%=RadioButtonList1.ClientID %> input[type=radio]:checked').val());
    <form id="form1" runat="server">
        <asp:RadioButtonList ID="RadioButtonList1" runat="server" RepeatDirection="Horizontal"
            <asp:ListItem Selected="True" Text="Yes" Value="0"></asp:ListItem>
            <asp:ListItem Text="No" Value="1"></asp:ListItem>
        <a href="#" id="button" onclick="getvalue()">click me</a>

No comments:

Post a Comment