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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:00:22+00:00 2026-05-30T21:00:22+00:00

I have the following Jquery functions and it only works when the page is

  • 0

I have the following Jquery functions and it only works when the page is refreshed, notwhen I click a particular checkbox. Currently when I click a checkbox it does not do anything. How do I make the checkbox do something then?

(function($) {
    $(document).ready(function() {
        alert("nyah nyah! I’m able to use '$'!!!!");
        var $b = $('input[type=checkbox]');
        alert($b.find(':checked').length); 
        alert($b.filter(':not(:checked)').length);

        function checkPrice() {
            alert($b.filter(':checked').length);
        }

        $("#keywordForm").submit(function(e) {
            e.preventDefault();
            var option_form = jQuery(e.target);
            <!--alert("sometext");-->
            updateKeywords(e);
        })

        $("#updateKeyword").submit(function(e) {
            e.preventDefault();
            var keyword_form = jQuery(e.target);
            refreshKeywords(e);
        })

        function refreshKeywords(e) {
            e.preventDefault();

Checkbox HTML:

List of Keywords available for subscription

                        <table id="checkKeywords">
                            <tbody>
                                {% for keyword in keyword_list %}
                                    {% if forloop.counter|divisibleby:"3" %}
                                            <tr>
                                    {% endif %}
                            <td>
                                <input type="checkbox" id="validate" name="cb" onclick = checkPrice(this) value="{{keyword.keyword_name}}" />  {{keyword.keyword_name}}
                            </td>
                                    {% if forloop.counter|add:"1"|divisibleby:"3" %}
                                            </tr>
                                    {% endif %}
                                {% endfor %}
                            </tbody>
                        </table>                
  • 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-30T21:00:23+00:00Added an answer on May 30, 2026 at 9:00 pm

    If you want to do something when the checkbox is clicked on, you need to bind a callback function to the change event using the .change() function, like this:

    $('selector for checkbox(es)').change(function(e) {
        // do your stuff here
    });
    

    You could also use the click event, but that doesn’t recognise the value being changed using the keyboard in all browsers, so it’s probably best not to.

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

Sidebar

Related Questions

Assuming I have the following two JQuery functions - The first, which works: $(#myLink_931).click(function
I have the following jquery script: $(function(){ $('#top-menu').on('click', 'a.change-menu', function(e){ e.preventDefault() $(#menu-change-div).load($(this).attr(href)); }); });
I have the following Jquery running in an aspx page without the use of
The following gwt jsni method code only works when I have firebug open, I
I'm using the jQuery Validation Plugin on my page and have the following code
I have the following jquery function that submits to an iframe. The message sent
I have the following jquery code: jQuery(function(){ jQuery(select#rooms).change(function(){ var options = ''; jQuery.getJSON(/admin/selection.php,{id: jQuery(this).val(),
I have the following jquery function for filtering the contents of a listbox on
I have the following jquery function > <script type=text/javascript> > > $(document).ready(function() { >
I have the following jQuery function: $(function(){ if ($(.menu li).hasClass(active)) { $(.active).css(margin-top, 6px); }

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.