Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7908145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:47:33+00:00 2026-06-03T11:47:33+00:00

I have an ASP .Net page with a radio button group and a text

  • 0

I have an ASP .Net page with a radio button group and a text area.

I want to toggle the Crime Description textarea, so that if they select “Yes” they must explain the circumstances. Otherwise, the textarea remains hidden for everyone else.

Both are runat server, so the web form master page creates a generated ID for both. However, I cannot seem to get the value of the radio button.

I have tried several of the solutions in other threads, but they have not been working.

Here are several JQ methods I have tried:

//.Net throws an error and says that ClientId is not a property of the radio group.
$('#<%= Crime.ClientId %>').bind('change', function () {

   var checked = $(this).find('input:radio:checked');
   if (checked.length == 0) {
                alert("NO");
            }
   else {
                alert("YES");
            }

   var myRadio = $(this);

                           var checkedValue = myRadio.filter(':checked').val();

                            var show = myRadio.val() == "Yes";

                           var showOrHide = (myRadio.val() == 1) ? true : false;

                            alert(show + " " + showOrHide + " " + checkedValue);
                            $('#<%= CrimeDescription.ClientID %>').toggle(showOrHide);

        });

I’ve also applied a class to the ASPX control and tried variations on this:

$('.CrimeToggle').click(function () {
                        //maybe traverse down to find the selected???
                    });

.Net ASPX

<asp:RadioButtonList RepeatDirection="Horizontal" CssClass="CrimeToggle" ID="Crime" runat="server">
             <asp:ListItem Value="Yes">Yes</asp:ListItem>
             <asp:ListItem Value="No">No</asp:ListItem>
</asp:RadioButtonList>

<textarea runat="server" id="CrimeDescription"></textarea>

I need to select the selected radio button and get its value.

I must use the RadioButtonList control and not an input (because the backend is doing other things to the control as well).

Here is the output html that .Net generates:

<table id="ctl00_BodyHolder_Crime" class="CrimeToggle" border="0">
<tbody>
<tr>
<td>
<input id="ctl00_BodyHolder_Crime_0" type="radio" value="Yes" name="ctl00$BodyHolder$Crime">
<label for="ctl00_BodyHolder_Crime_0">Yes</label>
</td>
<td>
<input id="ctl00_BodyHolder_Crime_1" type="radio" value="No" name="ctl00$BodyHolder$Crime">
<label for="ctl00_BodyHolder_Crime_1">No</label>
</td>
</tr>
</tbody>
</table>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T11:47:44+00:00Added an answer on June 3, 2026 at 11:47 am

    This is what I ended up with if anyone has the same issue.

    $('#<%= Crime.ClientID %>').click(function () {
    
                var showHide = $('.CrimeToggle').find('input:radio:checked').val() == "Yes";
    
                $('#<%= CrimeDescription.ClientID %>').toggle(showHide);
    
    });
    

    For some reason, what I had originally started to work again. Visual Studio can be so buggy at times. Strange.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ASP.NET page with an asp:button that is not visible. I can't
I have an ASP.Net-MVC application that is mostly complete. However, I have one page
I have an ASP.NET page that gets a list of game server ip addresses
I've made a asp.net page that creates an Excel workbook. I have set the
i have a page built in asp.net c#. it holds a list of radio
I have an ASP.NET page that's going to use Html controls to render a
i have to create one asp.net mvc page that will show template of controls.
I have asp.net's .aspx page. that have GridView let say GridViewParent and Each row
I have a list of radio buttons on my ASP.NET page displayed thus:- <asp:RadioButtonList
I have an ASP.NET page A that uses a data layer assembly DAL .

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.