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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:29:06+00:00 2026-05-15T09:29:06+00:00

function checkAll(custId){ var id; if(document.getElementById(custId).checked == true){ <%for (CustomerGroup custGroup : customerGroupList) {%> if(custId==<%=custGroup.getCustomerGroupId()%>){

  • 0
function checkAll(custId){
        var id;
        if(document.getElementById(custId).checked == true){
        <%for (CustomerGroup custGroup : customerGroupList) {%>

            if(custId==<%=custGroup.getCustomerGroupId()%>){
                <%List<Account> list = accountDelegate
                    .findAccountEntityByGroupId(custGroup
                            .getCustomerGroupId());
            for (Account account : list) {%>
                        id=<%=account.getAccountId()%>
                        document.getElementById(id).checked=true;
                <%}%>
            }
    <%}%>
    }else {
        <%for (CustomerGroup custGroup : customerGroupList) {%>

            if(custId==<%=custGroup.getCustomerGroupId()%>){
            <%List<Account> list2 = accountDelegate
                    .findAccountEntityByGroupId(custGroup
                            .getCustomerGroupId());
            for (Account account : list2) {%>
                        id=<%=account.getAccountId()%>
                        document.getElementById(id).checked=false;
            <%}%>
    }
    <%}%>
}
}

Here I have passed custId as a id of checkbox.Problem here is if(document.getElementById(custId).checked == true

each time this condition will evaluate to false and thus control goes on else part.
so how can i know wether checkbox is cheched or not ?.

  • 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-15T09:29:07+00:00Added an answer on May 15, 2026 at 9:29 am

    The checked property is what you need to use to verify if a checkbox is checked:

    <html>
    <head>
        <title>Test</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <script type="text/javascript">
        window.onload = function() {
            if (document.getElementById('test').checked) {
                alert('the checkbox is checked');
            }
        };  
        </script>
    </head>
    <body>
    
    <input id="test" name="test" type="checkbox" checked="checked" />
    
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this right now: $('#markAll').live('click', function () { checkAll(true, $('.cbPick')); $('#markAll').text(); $('#markAll').prepend(<strong>Unmark all</strong>);
function checkUncheckAll(theElement) { var theForm = theElement.form, z = 0; while (theForm[z].type == 'checkbox'
I'm trying to pass a c# variable as an argument to a java-script function
As the title says, I can't get .attr('checked', false) to work on IE6. I
I'm running into some type of error here. Nothing is happening. Does anyone have
I am trying to add a class to my tr rows if the select
Before I dive in to the jQuery/Sizzle source I thought i'd ask here about
I'm currently trying to get into jQuery. And I'm having a hard time (-;
First off I would like to say, that I am not trying to hack
I have already developed class1.py, class2.py, etc. with functions implemented inside each class. e.g.

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.