Question: I have a code (not written by me) of a button that bookmarks a person and add it to a shortlist. It looks like this:

JS & Ajax part:

```
self.isShortlisted = ko.observable(@(Model.Application.IsShortlisted ? "true" : "false" ));

self.isHidden = ko.observable(@(Model.Application.IsHidden ? "true" : "false" ));

$('form#shortlistForm').ajaxForm(function () {
    viewModel.applicationViewModel.isShortlisted(true);
});

$('form#unshortlistForm').ajaxForm(function () {
    viewModel.applicationViewModel.isShortlisted(false);
});

```

Answer: 
You are mixing jQuery with Knockout. The submit is handled by jQuery. **If you use Knockout, let it to handle the submit event** adding to the `<form>` this `submit: submitShortlistForm,`:

```
<form id="shortlistForm" data-bind="submit: submitShortlistForm, style: { display: application.isShortlisted === false ? 'inline-block' : 'none'}, attr: {action: '@(MVC.GetLocalUrl(MVC.HireOrgJobApplication.ViewApplication(Model.CurrentOrganization.CustomUrl, Model.Job.JobKey, "xxx/ajax-shortlist")))'.replace('xxx', application.applicationKey)}" method="post" style="display:inline;">
    @Html.AntiForgeryToken()
    <input type="hidden" name="ApplicationKey" data-bind="attr:{ value : application.applicationKey }" />
    <button type="submit" class="btn-act jui-tooltip" title="Shortlist">
        <i class="fa fa-2x fa-star"></i>
    </button>
</form>                 

```

Then, in your view model add this:

```
self.submitShortlistForm = function(){
    // I think is better to use $.post() or $.ajax().
    // I use the pluging because is in your question.
    $('form#shortlistForm').ajaxForm(function () {
        // Allways change position [0] of the observable array
        self.applications()[0].isShortlisted = true;

        var data = self.applications().slice(0);
        self.applications([]);
        self.applications(data);
    });
    $(this).ajaxSubmit();
}

```

In the Knockout submit event I bind the form with the `ajaxForm` plugin, and then I submit it. I'm not sure about jQuery Plugin, I would use `$.post()` or `$.ajax()`.

You could find more information about Knockout submit in this link [The "submit" binding](http://knockoutjs.com/documentation/submit-binding.html).

I don't like this solution because you are removing all the content of the `self.applications` observable array. Is better to use the [mapping plugin](http://knockoutjs.com/documentation/plugins-mapping.html) and convert all `application` objects (and its content) in observables. But with this approach, you should modify your ViewModel and the view.

**Update 1 (19/06/2017)**

If this `<form>` is inside a `foreach` loop, then the `self.submitShortlistForm` could be this:

```
self.submitShortlistForm = function(application){
    $('form#shortlistForm').ajaxForm(function () {
        // Updates the current row element.
        application.isShortlisted = true;

        var data = self.applications().slice(0);
        self.applications([]);
        self.applications(data);
    });
    $(this).ajaxSubmit();
}

```

And the html:

```
<form id="shortlistForm" data-bind="submit: $root.submitShortlistForm, ...">

```

Hope this helps.
**Ajax** is a ***client-side script*** that communicates to and from a server/database without the need for a postback or a complete page refresh. 

The best definition for Ajax is 
*this Ajax method use for exchanging data with server and it only updates parts of webpage*