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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:01:21+00:00 2026-05-25T16:01:21+00:00

For example, I have 3 checkboxes. I want to trigger different events bases on

  • 0

For example, I have 3 checkboxes. I want to trigger different events bases on combinations of boxes being checked. For instance, I want an click event triggered on clicking checkbox 1 and a different event based on clicking both checkbox 1 and checkbox 2.

REVISED CODE:

        var tSalesPro = document.getElementById("chkSalesPro");
        var tSalesProPlus = document.getElementById("chkSalesProPlus");
        var tTellerPro = document.getElementById("chkTellerPro");

        function checkBoxChecked() {

            if (tSalesPro.checked && tSalesProPlus.checked && tTellerPro.checked) {
                alert("checkboxes all checked");
            }
            else if (tSalesPro.checked && tSalesProPlus.checked) {
                alert("checkbox 1 & 2 checked");
            }
            else if (tSalesProPlus.checked && tTellerPro.checked) {
                alert("checkbox 2 & 3 checked");
                tSalesProPlus.show();
                tSalesPro.hide();
                tTellerPro.hide();
                tSalesProPlus.checked = false;
                tTellerPro.checked = false;
            }
            else if (tSalesPro.checked && tTellerPro.checked) {
                alert("checkbox 1 & 3 checked");
                tSalesPro.show();
                tSalesPro.hide();
                tSalesProPlus();
                tSalesPro.checked = false;
                tSalesProPlus.checked = false;
            }
            else if (tSalesPro.checked) {
                alert("checkbox 1 checked");
                tSalesPro.show();
                tSalesProPlus.hide();
                tTellerPro.hide();
                tSalesProPlus.checked = false;
                tTellerPro.checked = false;
            }
            else if (tSalesProPlus.checked) {
                alert("checkbox 2 checked");
                tSalesProPlus.show();
                tSalesPro.hide();
                tTellerPro.hide()
                tSalesPro.checked = false;
                tTellerPro.checked = false;
            }
            else if (tTellerPro.checked) {
                alert("checkbox 3 checked");
                tTellerPro.show();
                tSalesPro.hide();
                tSalesProPlus();
                tSalesPro.checked = false;
                tSalesProPlus.checked = false;
            }
        }

        tSalesPro.onclick = checkBoxChecked;
        tSalesProPlus.onclick = checkBoxChecked;
        tTellerPro.onclick = checkBoxChecked;
  • 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-25T16:01:22+00:00Added an answer on May 25, 2026 at 4:01 pm

    Below is a simple example of showing how to use javascript and onclick events in order to determine which checkboxes are checked.

    <input type="checkbox" id="chkSalesPro">
    <input type="checkbox" id="chkSalesProPlus">
    <input type="checkbox" id="chkTellerPro">
    
    
    <script type="text/javascript">
    $(document).ready(function () {
    
         function checkBoxChecked() {
           var tSalesPro = $("#chkSalesPro");
           var tSalesProPlus = $("#chkSalesProPlus");
           var tTellerPro = $("#chkTellerPro");
    
           if (tSalesPro[0].checked && tSalesProPlus[0].checked && tTellerPro[0].checked) {
               alert("checkboxes all checked");
           }
           else if (tSalesPro[0].checked && tSalesProPlus[0].checked) {
               alert("checkbox 1 & 2 checked");
           } 
           else if (tSalesProPlus[0].checked && tTellerPro[0].checked) {
               alert("checkbox 2 & 3 checked");
           }
           else if (tSalesPro[0].checked && tTellerPro[0].checked) {
               alert("checkbox 1 & 3 checked");
           }
           else if (tSalesPro[0].checked) {
               alert("checkbox 1 checked");
           }
           else if (tSalesProPlus[0].checked) {
               alert("checkbox 2 checked");
           }
           else if (tTellerPro[0].checked) {
               alert("checkbox 3 checked");
           }
       };
       $("#chkSalesPro, #chkSalesProPlus, #chkTellerPro").change(checkBoxChecked);
    });
    </script>
    

    Here is an example http://jsfiddle.net/T8YMh/5/

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

Sidebar

Related Questions

Example: I have an class that inherits from UIImageView. An object creates an instance
I have a for loop that check whether some checkboxes are checked foreach (CheckBox
I have multiple checkboxes. I want to check and uncheck some of them or
I have a group of checkboxes that all represent different selections of the same
For example: i have three checkboxes in my preference screen and there is 3
I have an array of checkboxes on the page and I want to save
I have a jsp page with dynamically created checkboxes. When we check boxes, a
Problem: We have x checkboxes and we want to check y of them evenly.
I have a Table with checkboxes. I want to change the selection of the
I have a jQuery UI Dialog containing some checkboxes. I want to conditionally set

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.