mardi 15 septembre 2015

Code for checkbox changed not working on all pages [duplicate]

This question already has an answer here:

I am using dataTable.jquery and I have a table that has several pages. Each row has a checkbox, and there is a checkbox for Select All. Now, I have some code that executes on checkbox.change, but it works on first page only. If I go to any other pages, it just checks the checkbox and does nothing. When I return to a page, all the checkboxes I've checked previously are unchecked.

Here is the code:

$('.bulk-checkbox').change(function(){
  alert("checkbox changed");
  if(this.checked) {
    alert("checkbox checked");
  }
  else {
    alert("checkbox NOT checked"); 
    } 
});




Aucun commentaire:

Enregistrer un commentaire