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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:08:30+00:00 2026-06-12T14:08:30+00:00

I have a checkbox and click event for checkbox for updating data. When I

  • 0

I have a checkbox and click event for checkbox for updating data. When I click on the checkbox the data is updating but the checkbox does not get not checked.

This is my html code:

<td>
 <input type="checkbox" data-bind="checked: status, disable: status, click: $root.UpdateStatus" />
</td>

This is my script:

self.UpdateStatus = function (tblUsers) {
    $.ajax({
        type: "POST",
        url: 'SinglePageApp.aspx/UpdateStatus',
        data: "{statusVal: 'true',goalId: " + tblUsers.goalId + "}",
        contentType: "application/json; charset=utf-8",
        success: function (result) {
            alert(result.d);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            alert(textStatus);
            alert(errorThrown);
        }
    });
};

I want my checkbox to get checked when it is clicked. And after that put updated data after checkbox clicked.

  • 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-06-12T14:08:31+00:00Added an answer on June 12, 2026 at 2:08 pm

    See: http://knockoutjs.com/documentation/click-binding.html

    Note 3: Allowing the default click action
    By default, Knockout will prevent the click event from taking any
    default action. This means that if you use the click binding on an a
    tag (a link), for example, the browser will only call your handler
    function and will not navigate to the link’s href. This is a useful
    default because when you use the click binding, it’s normally because
    you’re using the link as part of a UI that manipulates your view
    model, not as a regular hyperlink to another web page.

    However, if you do want to let the default click action proceed, just
    return true from your click handler function
    .


    Edit: added example showing where to return true in the function. It has to be return from the actual function itself, not the Ajax success or error handler.

    self.UpdateStatus = function (tblUsers) {
        $.ajax({
            type: "POST",
            url: 'SinglePageApp.aspx/UpdateStatus',
            data: "{statusVal: 'true',goalId: " + tblUsers.goalId + "}",
            contentType: "application/json; charset=utf-8",
            success: function (result) {
                alert(result.d);
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                alert(textStatus);
                alert(errorThrown);
            }
        });
        // Return true to allow default click action.
        return true;
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this js code: $(#startSearch).live(click, function(event) { $(input:checkbox[name='searchId']:checked).each(function() { var searchId = $(this).val();
I have this code $('#Submit').click(function(event) { var checked = $('.inputchbox'); ......IE8 var ids= checked.map(function()
I have make code to make directory on click event of button. But I
I have a click event that does this: $('table tbody td').click( function (e) {
I have a Javascript function bound to the click event of an INPUT element
The checkbox data-binding value is not changing when i try to trigger the click
I have a table with misc. data. Each row has a checkbox. This table
I have a checkbox-button-group like this: <div class=btn-group id=id_group data-toggle=buttons-checkbox> <button class=btn myclass type=button
i have disabled all the checkboxes except one. On click of that checkbox i
I have checkBox and Spinner . If the checkbox is checked, then spinner should

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.