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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:50:54+00:00 2026-05-26T13:50:54+00:00

I am having difficulty finding specifically what I’m searching for, most likely because I’m

  • 0

I am having difficulty finding specifically what I’m searching for, most likely because I’m not sure how to express it well in a Google search.

Basically what I would like to do is display 30 or so buttons that users would then be able to select. Once selected a button changes color indicating that the particular option has been chosen. Users are required to select 10 out of 30 options. The results should then be aggregated (basically counting each unique button selected) and displayed to another user who can login and see the results.

Multiple users should be able to select these options and have their results recorded.

I’m not looking to create a drop down list, multi-list, or checkbox solution. In my research so far I have found plenty of references to this type of option. Also, Javascript restricting the min/max number of checkboxes a user can select.

I hope that makes sense. Any assistance with identifying the best method for going about this task would be greatly appreciated.

Thank You,

-Nathan

  • 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-05-26T13:50:55+00:00Added an answer on May 26, 2026 at 1:50 pm

    What you can do, you can create 30 buttons, and connect each button to a hidden check box, then you can post it to server, eg.

    <input type="checkbox" value="1" name="chk_one" id="chk_one" style="display: none;">
    <input type="button" value="Check Box One" id="btn_one"/>
    

    CSS

    input[type="button"].selected { color: red; }
    input[type="button"] { color: black; }
    

    then you can write jQuery solution in order to make it change colors:

    var _minLength = 10;
    var _maxLength = 30;
        $(document).ready(function() {
            $('#submit_id').click(function() { 
               if($('#form_id input[type="checkbox"]').is(':checked').length < _minLength) 
                { 
                  alert('you need to select at least ' + _minLength + ' of buttons'); return false; 
                };});
            $('#form_id input [type="button"]').click(function() {
                var _id = $(this).attr('id').toString().split('_')[1];
                if(_id != null)
                {
                   var _chckBox = $('#chk_'+_id);
                   var _newState =  _checkBox.attr('checked') ? false, true;
                   if($('#form_id input[type="checkbox"]').is(':checked').length+1 > _maxLength)
                      return;
    
    
                   _checkBox.attr('checked', _newState);
                   if(_checkBox.attr('checked'))
                      $(this).addClass('selected');
                   else
                      $(this).removeClass('selected');
                 }
            });
        });
    

    Method from above will attach click event to every button in the area you specified with “#form_id” then when clicked it will toogle state of hidden checkbox and will set or remove class from button, it depends of checkbox state.

    And by the way number of checkboxes is not limited.

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

Sidebar

Related Questions

Hilariously, I'm having incredible difficulty finding any half-good way to determine whether or not
I've done a significant amount of searching and am having difficulty finding people who
I'm currently having difficulty finding a way of making my loops work. I have
I'm having difficulty searching for this. How would I define an element in an
I am working on creating a python c extension but am having difficulty finding
I'm looking to crowd-source this, as I'm having bit of difficulty finding an industry
Having a bit of difficulty finding out the proper way to mix in code
Im having difficulty finding an algorithm for the following puzzle- A string is called
I'm new to core data and having some difficulty finding any information about sorting
I'm working with Views 2 in Drupal 6, and I am having difficulty finding

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.