Get selected radio button values using JQuery

Gets selected value from radio button group using jQuery:



<script type="text/javascript">
        function Getsal() {
            var selctedval = $('input[name=rdbage]:checked').val();
            if (selctedval != '' && typeof selctedval != 'undefined') {
                alert('You Selected ' + selctedval + ' salary');
            }
            else {
                alert('Please Select salary Group')
            }
        }
    </script> 

Get selected values from radio button group using jQuery:

Use jquery-1.9.1.js file here we give url also for get this file form web.

Get Selected Values From Radio Button using jQuery:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Get radio button selected value by JQuery</title>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <script type="text/javascript">
        function Getsal() {
            var selctedval = $('input[name=rdbage]:checked').val();
            if (selctedval != '' && typeof selctedval != 'undefined') {
                alert('You Selected ' + selctedval + ' salary');
            }
            else {
                alert('Please Select salary Group')
            }
        }
    </script>
    <style type="text/css">
        #btnGetAge
        {
            height: 39px;
        }
        .style1
        {
            height: 44px;
            color: #FFFFFF;
            font-weight: 700;
            font-size: x-large;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div align="center">
    <h1>
    Get radio button selected value by JQuery
    </h1>
        <b>Select salary Rang:</b>
        <table bgcolor="#CC0000" border="2" style="width: 532px">
            <tr>
                <td class="style1" align="center">
                    <input type="radio" name="rdbage" value="10000 - 15000 " />
                    10000 - 15000
                    <br />
                    <input type="radio" name="rdbage" value="15000 - 20000 " />
                   15000 - 20000
                    <br />
                   <input type="radio" name="rdbage" value="20000 - 30000 " />
                   20000 - 30000<br />
                  
                </td>
            </tr>
            <tr>
            <td align="center">
             <br />
                    <input type="button" id="btnGetAge" value="Get Salary Group" onclick="Getsal()" />
            </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html> 


Get radio button checked value jquery:

In this Example we take 3 radio button in a salary group and display selected salary group button value by jquery.

How to Get The Value of Selected Radio Button Using jQuery:

Get selected radio button values using JQuery

JQuery  And Asp.net related Posts:



Comments

  1. try this code,

    Code Working : **How to Hide / Show Div Tag When ASP.NET RadioButtonList Select**

    http://allittechnologies.blogspot.in/2015/04/how-to-show-hide-div-tag-based-on-radiobuttonlist-click-using-jquery-and-javascript.html

    ReplyDelete

Post a Comment

Popular posts from this blog