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

The Archive Base Latest Questions

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

I have two groups of checboxes, when i click on first group of checkboxes

  • 0

I have two groups of checboxes, when i click on first group of checkboxes the second group of checkbox should be unchecked.
but the second checkbox unchecked when I click on first checkbox two times.
here is my javascript code

 <script>
            function uncheck0(){
                for(var ii=1; ii<=3; ii++){
                    if(document.getElementById("q6_"+ii).checked==true){
                       document.getElementById("q6_"+ii).checked=false;
                    }
                }
            }
            function uncheck(id, from, to){
                for(var ii=from; ii<=to; ii++){
                    if(document.getElementById(id+ii).checked==true){
                       document.getElementById(id+ii).checked=false;
                    }
                }
            }
        </script>

and here is my html code first group has radio-buttons and second has checkboxes

<p>IF YES: When will the review begin?</p>
            <label  for="q6"><input type="radio" class="styled" value="Within the next 12 months" name="q6[]" id="q6_1">Within the next 12 months</label>
            <label  for="q6"><input type="radio" class="styled" value="Within the next 24 months" name="q6[]" id="q6_2">Within the next 24 months</label>
            <label  for="q6"><input type="radio" class="styled" value="We are currently doing it" name="q6[]" id="q6_3">We are currently doing it</label><br>
        <br>
        <p>IF NO: Why Not</p>
            <label onclick="uncheck('q6_',1,3);" for="q6"><input type="checkbox" class="styled" value="Lack of budget" name="q6[]" id="q6_4">Lack of budget</label>
            <label onclick="uncheck('q6_',1,3);" for="q6"><input type="checkbox" class="styled" value="Lack of resource" name="q6[]" id="q6_5">Lack of resource</label>
            <label onclick="uncheck('q6_',1,3);" for="q6"><input type="checkbox" class="styled" value="Do not see the need" name="q6[]" id="q6_6">Do not see the need</label>
            <label onclick="uncheck('q6_',1,3);" for="q6"><input type="checkbox" class="styled" value="Lack of know how/expertise" name="q6[]" id="q6_7">Lack of know how/expertise</label>
            <label onclick="uncheck('q6_',1,3);" for="q6"><input type="checkbox" class="styled" value="Complexity" name="q6[]" id="q6_8">Complexity</label>
            <label onclick="uncheck('q6_',1,3);" for="q6"><input type="checkbox" class="styled" value="Contractual obligations" name="q6[]" id="q6_9">Contractual obligations</label>
            <label onclick="uncheck('q6_',1,3);" for="q5"><input type="checkbox" class="styled" value="Other" name="q6[]" id="q6_10">Other </label>
            <label onclick="uncheck('q6_',1,3);" for="q5a">Please state</label><input type="text" value="" id="q6a" name="q6a">

I have use a javascript file “custom-form-element.js” for checkbox and radio styling

  • 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-05T12:45:06+00:00Added an answer on June 5, 2026 at 12:45 pm

    Move the onclick="uncheck('q6_',1,3);" from the labels to the input boxes.
    Your final code should look something like:

    <label for="q6">
        <input type="checkbox" onclick="uncheck('q6',1,3);" class="styled" value="Lack of budget" name="q6[]" id="q6_1">Lack of budget</label>
    <label onclick="uncheck('q6_',1,3);" for="q6_2"><input type="checkbox" class="styled" value="Lack of resource" name="q6[]" id="q6">Lack of resource</label>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following two table: -Groups- Id Name -Members- Id GroupId (Group.Id is
I have two roles in devise. The first is the admin and the second
I have two checkbox groups that I ultimately need to have one of them
I have a permissions problem with group rights section. I have two groups: A,
I have two groups of Pictureboxes Pic_1 Pic_2 ... and another group: Pic_1_copy, Pic_2_copy,
I have two checkbox groups that I ultimately need to have one of them
TO BE CLEAR: I have two groups of users - GroupA - User1, User2
I have two validation groups: parent and child I have an add button that
I have the following two tables Groups Id (int) People Id (int) GroupId (int,
I have two models, user and group. I also have a joining table groups_users.

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.