Click here to Skip to main content
15,894,630 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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:
HTML
 <td>
<input type="checkbox" data-bind="checked: status, disable: status, click:$root.UpdateStatus" />
</td>


This is my script:
JavaScript
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.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900