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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:16:16+00:00 2026-06-11T02:16:16+00:00

​<form> <label for=1>Text 1</label> <input type=checkbox name=1 value=something1 id=1><br> <label for=2>Text 2</label> <input type=checkbox

  • 0
​<form>
    <label for="1">Text 1</label>
        <input type="checkbox" name="1" value="something1" id="1"><br>
    <label for="2">Text 2</label>
        <input type="checkbox" name="2" value="something2" id="2"><br>
    <label for="3">Text 3</label>
        <input type="checkbox" name="3" value="something3" id="3"><br>
    <label for="4">Text 4</label>
        <input type="checkbox" name="4" value="something4" id="4">
</form>​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

Those are the checkboxes , I have tried to search all over the internet and didn’t find anything.

I want to allow the user to check id 3 and 4 BUT if he checks 1 , then 2 is not available to check, or if he checks 2 then 1 is not available to check.
And to the unavailable to add a class .. named ..
grade-out{ color: #DDD;}

Hope u understand the problem. Thanks in Advance !!

  • 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-11T02:16:18+00:00Added an answer on June 11, 2026 at 2:16 am

    I would add data-groupid attribute to your checkboxes to identify which group they belong to. And then add a click handler to checkboxes belonging to group, which would disable all other checkboxes in the same group when checked and enable them when unchecked..

    Assumming your markup is consistent and labels are always predecessors of respective checkboxes, you can easily target them using the prev() method.

    $('input:checkbox[data-group]').click(function() {
    
        var groupid = $(this).data('group');
        var checked = $(this).is(':checked');
    
        if(checked) {
    
            $('input:checkbox[data-group=' + groupid + ']').not($(this))
               .attr('disabled', 'disabled')
               .prev().addClass('grade-out');
    
        } else {
    
            $('input:checkbox[data-group=' + groupid + ']')
               .removeAttr('disabled')
               .prev().removeClass('grade-out');
    
        }
    
    });
    

    DEMO

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

Sidebar

Related Questions

i want insert this form value to datanase : <input type=checkbox name=brand1 id=brand1 value=1>
I have this form. <table><tr><td> <FORM> <label> ID </label></td> <td> <input type=text id=inputp1_id size=24
<form id=youtube-form method=post action=> <label for=searchField id=label-youtube-id>YouTube ID:</label> <input type=text id=searchField name=videoid class=search-field />
form html: <form action='/register/' method = 'post'>{% csrf_token %} ... <label>Avatar: </label><input type='file' name='avatar'
I have an Element Like <div class=control> <label>&nbsp;</label> <input type=checkbox id=1><span class=controlText>Check Box</span> <div
This is the checkbox <input id=c1 type=checkbox name=hour[] class=create-daily value=1 /><br /> <input id=c2
So I have this text input in a form, and I want to update
My form.html <form id=search-form method=post action=. name=f> <p><label for=id_customer_type>Customer type</label> <select name=customer_type id=id_customer_type> <option
I'd like to add some TeX text to my Qt form, like label -
I have a form that has label values that I would like to pass

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.