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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:04:41+00:00 2026-06-01T01:04:41+00:00

i have one problem controlling checkbox, i’m reading, and searching about the topic but

  • 0

i have one problem controlling checkbox, i’m reading, and searching about the topic but i can’t find anything that works for me, first i have 3 checkboxes on a asp.net mvc form

<%= Html.CheckBox("cbCodigo") %> <label class="inline" for="Codigo">Codigo</label>
<%= Html.CheckBox("cbNombreCliente") %> <label class="inline" for="NombreCliente">Nombre del cliente</label>
<%= Html.CheckBox("cbCiudad") %> <label class="inline" for="Ciudad">Ciudad</label>

i want to control using jquery, that the user, just can check one of the checkbox, i try to use hide(); if the user check one checkbox the others just hide, but the control of the events is so hard, that isn’t the best way to do that i think.

thanks

Edit: answer to my own question

i know it´s just to rare hide the other options, i just want to “lock” the other options when i checked one of them, i solve it with this:

$('#cbCodigo').change(function() {
                if ($(this).is(':checked')) {
                    $('#cbNombreCliente').prop("checked", false);
                    $('#cbCiudad').prop("checked", false);
                }
            });

$('#cbNombreCliente').change(function() {
                if ($(this).is(':checked')) {
                    $('#cbCodigo').prop("checked", false);
                    $('#cbCiudad').prop("checked", false);
                }
            });

$('#cbCiudad').change(function() {
                if ($(this).is(':checked')) {
                    $('#cbCodigo').prop("checked", false);
                    $('#cbNombreCliente').prop("checked", false);
                }
            });
  • 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-01T01:04:42+00:00Added an answer on June 1, 2026 at 1:04 am
    var $checkboxes = $('#cbCodigo, #cbNombreCliente, #cbCiudad');
    
    $checkboxes.change(function(){
            $checkboxes.not(this).hide();
        });
    

    Though I can’t really understand why do you need such a weird requirement.
    Don’t you want letting the user revert his choice with other checkbox?

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

Sidebar

Related Questions

I'm almost finished with my program, but I have one problem that I can't
I have one problem in my application. the problem is that can i bind
One problem I have with open-source is not often the product or documentation, but
The problem: we have one application that has a portion which is used by
I have problem with session in cakephp.I have one file chat.php that is in
One problem that I come across regularly and yet don't have a solution to
I have one problem in which i simply want to know how i can
I have one problem in my home page design. Problem is that I don't
I have one problem with a gridview control and maybe someone can help me.
I have one problem to work with NSMutableData . I defined one NSMutableData *receivedData

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.