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

  • SEARCH
  • Home
  • 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 7707739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:26:13+00:00 2026-06-01T00:26:13+00:00

I have 2 radio button with 2 group. The structure is like this Main

  • 0

I have 2 radio button with 2 group.

The structure is like this

  1. Main Radio 1
  2. Main Radio 2

Under Main Radio 2, there’s two more sub radio button.

  1. Main Radio 1
  2. Main Radio 2
    • Sub Radio 1
    • Sub Radio 2

What am I doing is, in default stage, it will only show Main Radio 1 and Main Radio 2 button. When choose Main Radio 2, two sub radio button of Main Radio 2 appear.

When choose back to Main Radio 1, it will hide the list of Main Radio 2.

The one that I want to achieve is,

When click Main Radio 1, the selection that I made for Sub Radio 1 or Sub Radio 2, want to be uncheck / reset too.

I tried with this javascript, but no success.

document.getElementById("subradiobuttons").reset(); 

Please kindly help me the solutions. Thank you.

With Regards,

  • 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-01T00:26:14+00:00Added an answer on June 1, 2026 at 12:26 am

    I think the best approach for a simple task like this does not needs a full JavaScript library like jQuery.

    document.getElementById("main2").addEventListener("click", function()
    {
        document.getElementById("subCheckButtons").style.opacity = 1;
    }, false);
    document.getElementById("main1").addEventListener("click", function()
    {
        document.getElementById("subCheckButtons").style.opacity = 0;
        document.getElementById("sub1").checked = false;
        document.getElementById("sub2").checked = false;
    }, false);
    <input type="radio" id="main1" name="main" />
    <input type="radio" id="main2" name="main" />
    <div id="subCheckButtons" style="opacity:0;">
        <input type="radio" id="sub1" name="sub" class="subCheck" />
        <input type="radio" id="sub2" name="sub" class="subCheck" />
    </div>

    Or see the fiddle.

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

Sidebar

Related Questions

I have a radio button group like this : <g:radioGroup name=myGroup values=[1,2,3] value=1 >
I have created radio button like this: @foreach (LoanQuestionIncludesStatement statement in item.Statements) { _question
I have a radio group with two radiobuttons. each button has a custom selector.
I have 3 different radio button group in jQuery like so: <tr class=toValidate> <td>Please
I have a radio button group on a survey form whose html looks like:
So I have a Radio button group, like so: <div data-role=fieldcontain> <fieldset data-role=controlgroup> <legend>Choose
I have the next radio button group: $enabled = $this->createElement('radio', 'enabled') ->setLabel('Enabled') ->setMultiOptions(array('1'=>'yes', '0'=>'no'))
I have a group of three radio buttons. Depending on which radio button is
We have a form with a radio button group, where any one of the
I have some stray text next to radio buttons in a radio button group.

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.