Click here to Skip to main content
15,892,517 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
i have two sets of radio buttons with group names of X and Y. in first set of radio button i have 5 radio buttons and in second set i have 2 radio buttons. My question is how to get the value or id of that radio button which i have clicked using java script and redirect that values to another page in asp.net..

my code of radio buttons as follows:

1st set of radio buttons:

<td width="60%" style="padding-bottom:10px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="10%" height="20" align="center"><label>
                          <asp:RadioButton ID="transactions" runat="server" GroupName="x"/>
                        </label></td>
                        <td width="90%" class="notxt">Transactions</td>
                      </tr>
                      <tr>
                        <td height="20" align="center"><asp:RadioButton ID="unsettled" runat="server" GroupName="x"/></td>
                        <td class="notxt"> Unsettled </td>
                      </tr>
                      <tr>
                        <td height="20" align="center"><asp:RadioButton ID="settled" runat="server" GroupName="x"/></td>
                        <td class="notxt"> Settled </td>
                      </tr>
                      <tr>
                        <td height="20" align="center"><asp:RadioButton ID="gaming" runat="server" GroupName="x"/></td>
                        <td class="notxt"> Gaming </td>
                      </tr>
                      <tr>
                        <td height="20" align="center"><asp:RadioButton ID="all" runat="server" GroupName="x"/></td>
                        <td class="notxt"> All (except Games)</td>
                      </tr>
                    </table></td>

2nd set of radio buttons:

<td width="60%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="10%" height="24" align="center"><asp:RadioButton ID="last" runat="server" GroupName="y"/></td>
                    <td width="90%">
                      <select name="select" class="lm1">
                        <option>Day</option>
                        <option>1week</option>
                        <option>2week</option>
                        <option>1month</option>
                        <option>2month</option>
                        <option>3month</option>
                        <option>6month</option>
                      </select></td>
                  </tr>
                </table></td>

<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="10%" height="24" align="center">
                        <asp:RadioButton ID="from" runat="server" GroupName="y"/>
                    </td>
                    <td width="15%" class="gtxt"><strong>From</strong></td>
                    <td width="75%">
                        <asp:TextBox ID="frmtxt" runat="server" CssClass="tf"></asp:TextBox>
                        <cc1:CalendarExtender ID="CalendarExtender1"
                     TargetControlID="frmtxt" Format="MM/dd/yyyy" runat="server">
                 </cc1:CalendarExtender>
                        </td>
                  </tr>
                </table></td>
Posted

1 solution

<script type="text/javascript">
var id=document.getElementById('ctl00_ContentPlaceHolder1_radiobutton');
        </script>
 
Share this answer
 
v2
Comments
Sudheer Peddaraju 24-Sep-12 4:10am    
its displaying "null"
Sudheer Peddaraju 24-Sep-12 4:49am    
some one please help me..

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