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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:39:26+00:00 2026-06-13T02:39:26+00:00

I have a set of random/dynamic generated div checkboxes: <div>A1 <input type=’checkbox’ name=’A[]’ value=’A1′>

  • 0

I have a set of random/dynamic generated div checkboxes:

<div>A1 <input type='checkbox' name='A[]' value='A1'> </div>
<div>A2 <input type='checkbox' name='A[]' value='A2'> </div>
<div>A3 <input type='checkbox' name='A[]' value='A3'> </div>
<div>B1 <input type='checkbox' name='B[]' value='B1'> </div>
<div>B2 <input type='checkbox' name='B[]' value='B2'> </div>
<div>C1 <input type='checkbox' name='C[]' value='C1'> </div>

What I am trying to do is when the user:

  1. checks any A then the others will hide (entire div) but all A will still show.
  2. unchecks a checkbox, then all A, B, C will show again.

This is because I am preventing the user from checking a mix of options.

PS:
You can provide a solution that might need me to modify the generated output of checkboxes.

  • 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-13T02:39:27+00:00Added an answer on June 13, 2026 at 2:39 am

    Thanks guys, especially dbaseman (get me ideal) :
    ok, Here is my code after referring from you all.

    $("input[type=checkbox]").on("click", function() {
        var sta = $(this).is(":checked"); sta=(sta==true?1:0);
        if(sta==1){
            var thisName = $(this).prop("name"); thisName=thisName.replace("[]","");
            $("div input[type=checkbox]:not([name^=" + thisName + "])").parent().hide();
        }else{
            var num = $("[type=checkbox]:checked").length;
        if(num==0){
                $("div input[type=checkbox]").parent().show();
        }
        }
    });
    

    so far code able is performing as what i need.
    Ps: i am still weak on jquery travelling part

    Ps: Edited on re-opening all checkboxes part
    Thanks once again!

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

Sidebar

Related Questions

I have a set of divs with random ids: <div id=container> <div id=2></div> <div
I have set a background on the data-role=page element like so <div data-role=page style=background:
I have to be able to set a random location for a waypoint for
I have a simple Matlab program that uses a set of random number lists
I am trying to generate 36 length random number that doest have 0, 1
I have a random set of points and want to create a smooth svg
I have a set of random links, like this: <a rel=foo> ... </a> ...
In redis.conf file we have set max memory policy to eviction policy to allkeys-random
This is a continuation from this post I have a set of random sized
I have a random set S={3,12,15,24,33,40} and I need to generate subsets of size

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.