Click here to Skip to main content
15,671,149 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to Check any value of RadioButtonList
document.getElementById("<%=rblTitle.ClientID %>").selected = document.getElementById("<%= hfTITLE.ClientID %>").value;

<asp:RadioButtonList ID="rblTitle" runat="server" RepeatDirection="Horizontal">
                                   <asp:ListItem Text="Mr" Value="Mr"></asp:ListItem>
                                   <asp:ListItem Text="Mrs" Value="Mrs"></asp:ListItem>
                                   <asp:ListItem Text="Ms" Value="Ms"></asp:ListItem>

How to select or check by javascript
You need to get the selected radio's value, right?
For example - if I select "Mr.", then you want the value "Mr." using javaScript.
If I am wrong, then correct me.
Member-515487 5-Feb-13 4:11am    
yes can u suggest how?
Please check my answer.

I would suggest you to go for jQuery, in which it is be very simple.

Steps to execute any jQuery code
1. Download the jQuery file from Official Website[^].
2. Place inside your project and include in your html (inside head section) like below.
<script type="text/javascript" src="jquery-1.2.6.min.js"></script>

Solution for the asked question
The code provided by you for RadioButtonList will be rendered in browser like below.
<table id="rblTitle">
                <input type="radio" value="Mr" name="rblTitle" id="rblTitle_0">
                <label for="rblTitle_0">Mr</label>
                <input type="radio" value="Mrs" name="rblTitle" id="rblTitle_1">
                <label for="rblTitle_1">Mrs</label>
                <input type="radio" value="Ms" name="rblTitle" id="rblTitle_2">
                <label for="rblTitle_2">Ms</label>

Now you have to work on this code in client-side using jQuery.

So, to get the selected value of radio button, use the below javaScript code in your page.
<script type="text/javascript">
     $(document).ready(function () {
         // Get the Radio Buttons.
         var rblTitle = $('#rblTitle').find('input:radio');
 () {
             // Get the selected value

The selected value will be shown in an alert.

Selected value of RadioButton inside RadioButtonList[^].

Share this answer
Try this
document.getElementById('yourRadioButtonId').checked = true;

Hope this help
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900