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 8041255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:09:09+00:00 2026-06-05T04:09:09+00:00

I was actually able to figure out my problem by assigning IDs to my

  • 0

I was actually able to figure out my problem by assigning IDs to my individual radio buttons and manipulating them that way, but I’m still bothered that I don’t understand why this doesn’t work.

Here’s the deal: let’s say I have two groups of radio buttons that look something like this:

<input type="radio" name="RadioGroup1" id="Group1True" value="True" /> True
<input type="radio" name="RadioGroup1" id="Group1False" value="False" /> False

<input type="radio" name="RadioGroup2" id="Group2True" value="True" /> True
<input type="radio" name="RadioGroup2" id="Group2False" value="False" /> False

I want the RadioGroup2 buttons affected, depending on what is selected in RadioGroup1. For example, if ID=”Group1True” is selected, then I want the RadioGroup2 buttons to be hidden (I have the RadioGroup2 buttons wrapped within a <div> tag to do this).

If, however, ID=”Group1False” is selected, not only do I want the RadioGroup2 buttons to reappear (which works fine), I also want the RadioGroup2 buttons to be reset and unchecked. This is where I run into problems.

I’ve tried all of the following combinations (and even a few more that I can’t remember). None of them do what I want.

if ( $("#RadioGroup1:checked").val() == "False" )
{

// HERE'S where I run into problems:

    // This line not only unchecks the RadioGroup2 buttons, it also unchecks
    // the RadioGroup1 buttons, which I DO NOT want it to do!!!!!!!!!

    $("input:radio[@name=RadioGroup2]").removeAttr("checked");


    // This line gives me a JavaScript error saying:
    // "Object doesn't support this property or method"!!!!!!!

    $("input[@name=RadioGroup2]").removeAttr("checked");


    // This line does absolutely nothing

    $("RadioGroup2").removeAttr("checked");

}

As I said, I was able to resolve my issue by referencing IDs instead of radio group names, but I’m still frustrated that I don’t know why this doesn’t work.

Could someone enlighten me?

  • 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-05T04:09:10+00:00Added an answer on June 5, 2026 at 4:09 am

    Your selector syntax is incorrect.

    $('input[name="RadioGroup1"]').whatever();
    

    (Actually I guess it’s not “incorrect” so much as “wrong”; your selectors were looking for a value on the “@name” attribute instead of “name”.)

    The # is for “id” values, not “name”, so #RadioGroup1 won’t work for you.

    Instead of .removeAttr("checked") you can alternatively set the “checked” property to false:

    $('input[name="RadioGroup1"]').prop("checked", false);
    

    You could also give groups of radio buttons a “class” value, which is a little more concise than using the element name:

    $('input.radio-group-1')
    

    or whatever. Of course, it’d mean more markup.

    Personally I think that’s the better way to go; when you’re messing with the DOM, you should manipulate DOM object properties, not element attributes. Removing the attribute would probably work however.

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

Sidebar

Related Questions

I can not figure out where my problem is but I am not able
Now this is a tricky problem for which I'm not able to figure out
This is a design problem that I am trying to figure out. I will
I have a simple problem . I am not able to figure out the
I have a semi-complicated problem and hoping that someone here will be able to
I'm having some problems trying to figure out how to solve a problem without
Ok so I have been trying to figure out a way to make plain
I have another pretty perplexing problem that one of you might be able to
Actually I created a button using the cobogw widget library. But the button does
actually this is not hang status, i mean..it slow response, so in that case,

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.