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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:17:03+00:00 2026-05-20T23:17:03+00:00

Please note that the scenario is ASP.NET Webforms + Master – Content page which

  • 0

Please note that the scenario is ASP.NET Webforms + Master – Content page which mess up the ids.
I have, say, three checkboxes

<asp:CheckBox ID="chkConsultantQuality" runat="server" 
            CssClass="company"/>
<asp:CheckBox ID="chkConsultantEnvironment" runat="server" 
            CssClass="company"/>
<asp:CheckBox ID="chkConsultantSafety" runat="server" 
            CssClass="company"/>

I would like to make a div id="CompanyPanel" on click event of each checkbox according to the following condition

  1. visible if any of the checkboxes are checked.
  2. hidden if all of the checkboxes are unchecked.

I am planning to use jQuery since I am selecting by class name. I could do it with jQuery.each on the class=’company’ by checking each for a checked flag.
Any better ideas?

  • 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-20T23:17:03+00:00Added an answer on May 20, 2026 at 11:17 pm

    There is a :checked ( http://api.jquery.com/checked-selector/ ) selector you can use :

    <script>
        $(document).ready(function() {
            $(".company input").click(function() {
                var cnt = $(".company input:checked").length;
    
                if( cnt == 0)
                {
                   // none checked
                   $('#CompanyPanel').hide();
                }
                else
                {
                   // any checked
                   $('#CompanyPanel').show();
                }
            });
        });
    </script>
    

    You may want to add (or use) an id on the container of these checkbox, to optimize selector speed.

    As for asp.net messing up client ids on controls, you can use

    $('<% =MyControl.ClientID %>')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

please note that I'm a complete beginner to Qt development. I have a QWebView
How can we consume WCF service in .Net 2.0 Winform. Please note that we
I have this issue: I have WebSite with asp.net pages. http://desiis:90/WebSite1 In this webSite,
Here's the scenario: You have a Windows server that users remotely connect to via
Here's a scenario: I have a java front end (RCP/SWT) app which currently has
Please note the Edit below for a lot more information, and a possible solution
Please note - I am not looking for the right way to open/read a
Please note: In each step I describe below I'm logged in as the same
How do I print debug messages in the Google Chrome JavaScript Console? Please note
In a brand new ASP.NET MVC2 project, I want the user to be redirected

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.