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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:20:54+00:00 2026-06-13T12:20:54+00:00

I have a list of checkboxes which are grouped by a priority number and

  • 0

I have a list of checkboxes which are grouped by a priority number and I want a way that a user can select multiple ones from different priority groups but only one from each

<input type='checkbox' value='1' name='priority[]'  />first choice in priority 1 group<br>
<input type='checkbox' value='2' name='priority[]'  /> second choice in priority 1 group <br>
<input type='checkbox' value='3' name='priority[]'  /> third choice in priority 1 group <br>
<input type='checkbox' value='4' name='priority[]'  /> first choice in priority 2 group <br>
<input type='checkbox' value='5' name='priority[]'  /> second choice in priority 2 group <br>
<input type='checkbox' value='6' name='priority[]'  /> third choice in priority 2 group <br>

So in the example above it would fine for a user to select 1 and 5 as they are in different priority groups, but not 1 and 2 as they are in the same priority group

So I’ve been thinking of using javascript to disable the other checkboxes in the group when one is checked, so for example if I select 1, then 2 and 3 would be disabled but not 4, 5 or 6

I’ve been looking to see if there is anything in jQuery’s library but can’t see anything, I was wondering if I could group the checkboxes together using id or tabindex and then do a disable that way but no luck so far
The checkboxes are dynamically generated from a database table so I can play around with sorting them or adding divs around them if needed
Can anyone help?

Cheers

Mike

  • 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-13T12:20:55+00:00Added an answer on June 13, 2026 at 12:20 pm

    1. What about this:

    $('.check').change(function() {
        var group = $(this).data('priority');
        $('.check[data-priority="' + group + '"]').not(this).prop('disabled', this.checked);
    })​;
    

    Demo http://jsfiddle.net/dfsq/Qvhxp/1/

    2.
    You would better use radio buttons instead of checkboxes (apply -webkit-appearance, -moz-appearance, if needed).

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

Sidebar

Related Questions

I have a list of checkboxes that I want to insert into a database,
I have List of Checkboxes which i want to create using FOR LOOP .
I have a list of checkboxes on a form, which updates the user's status.
I have a celltable in GWT which have checkboxes, to select multiple checkboxes i
I have a list view which contains checkboxes. How I can get if it
I have a list of checkboxes grouped into sections. Some of these checkboxes can
I have a list a simple dialog box which contains a few checkboxes, I
I have a list of Checkboxes & I want to get the status of
I have this long list of checkboxes with specific labels that look something like
I have this long list of checkboxes with specific labels that look something like

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.