1

I would like to disable the double click on checkboxes on internet explorer. The double click causes errors on the function (only on internet explorer 11).

 $('#editArchivesTable tbody').on('click', "input[type=checkbox]", function () { alreadySelected = $('#editArchivesTable tbody').find('input[type="checkbox"]:checked').parent('td').parent('tr').attr('choix(dataTable.row($(this).parent('td').parent('tr')).index(), $(this).is(':checked'))
});




$("#editArchivesTable tbody").bind('dblclick', "input[type=checkbox]", (function (event) {
    event.preventDefault();
}));

I'm waiting for my function choix not to be triggered when double clicking

For example, when double clicking on a checkbox, the value "85" is inserted twice in my list

2
  • 1
    Can you share the error?
    – Tien Duong
    Commented Jul 25, 2019 at 7:18
  • I added a picture on the post. Thank you in advance.
    – Dyn amo
    Commented Jul 25, 2019 at 7:53

1 Answer 1

1

Instead of the click event, use the change event.

In the change event check the state of the checkbox.

If it is checked, add the value to the array. If not, remove it from the array.

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.