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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:19:39+00:00 2026-05-30T09:19:39+00:00

Hello i’m trying to check if the checkboxes are checked or not. However my

  • 0

Hello i’m trying to check if the checkboxes are checked or not. However my checkboxes are created using a for loop and the value of each checkbox is actually the same.

Code is as follows:

{% for keyword in keyword_list %}
    {% if keyword.keyword_name == userprofile.keywords_subscribed  %}
        <input type="checkbox" disabled="disabled" name="keywords" value="keywords"/>   {{keyword.keyword_name}}<br />
    {% else %}
        <input type="checkbox" name="cb" value="keywords"  />   {{keyword.keyword_name}}<br />
    {% endif %}
{% endfor %}

Jquery code as follows:

<h2>Price of subscriptions</h2>
    <script type="text/javascript" src="/static/js/jquery-1.6.3.min.js"></script>
    <script type="text/javascript" src="/static/js/jquery-ui-1.8.16.custom.min.js"></script>
    <script type="text/javascript" src="/static/fc3/charts/FusionCharts.js"></script>
    <script type="text/javascript">
    function popup(){
        {% for price in price_list %}
            alert({{price.price_of_each_keyword}})
        {% endfor %}
    }
    function DoTheCheck() { if(document.cb2.checked == true)
                { alert('box2 is checked'); }
    }

    </script>

At the moment this is all i can think of.

So how do i use jquery to iterate through the checkboxes and check to see if they are checked?

I found some examples on the web but most of them actually created individual checkbox names for their code and this makes it easier to use jquery to check them.

Appreciate any help i can get.

Thank you.

  • 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-30T09:19:41+00:00Added an answer on May 30, 2026 at 9:19 am

    You can get a list of all checked checkboxes in the site with this:

    $('input[type=checkbox]:checked')
    

    SHORT

    As mentioned from Craig, there is a short version available as well:

    $(':checkbox:checked')
    

    COUNT

    And if you want to know the no of checked checkboxes, simply do this:

    $(':checkbox:checked').length
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello i been trying to get a tokenizer to work using the boost library
Hello I am trying to create a stacked barplot using the following code: test
hello I am using ubuntu on android(with chroot) I am trying to execute xev
Hello I'm trying to take backup from mysql command line client. I'm using mysqldump
Hello everyone i am trying to format the input number range with php number_format
hello friends i am trying to get a list of user id and want
Hello Guys I am trying to figure out why i am gettings this error
Hello , I am using arshaw fullcalendar v1.5.2 (only month view ) for property
Hello i have Mschart on a winform y axis is value 1,2 ... and
Hello All I am trying to flatten a list in Ocaml. I am a

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.