Delete button not toggling checkbox

Issue #8 new
georgema1982 created an issue

The doc says "If the forms can be deleted, and contain a delete button, pressing the delete button will toggle the delete checkbox for that form". But I think the reality is far from it. Pressing delete button will always keep the checkbox checked. Below is the snippet from the jquery.formset.js:

    $deleteButton.bind('click', function() {
        $delete.attr('checked', true).change();
    });

As seen from the snippet, whenever the delete button is clicked, the checkbox is checked, not toggled.

Comments (1)

  1. georgema1982 reporter

    I guess the way to fix it is to change the code as below:

        $deleteButton.bind('click', function() {
            $delete.prop("checked", !$delete.prop("checked")).change();
        });
    
  2. Log in to comment