jeudi 25 février 2016

Tick checkbox after ticking another checkbox

enter image description here

I want the checkboxes to be clicked within the table after clicking the checkbox situated outside the table. As you can see, the PHP runs properly for select all, but if the student below select all is ticked, the checkboxes having student as their member doesn't get ticked. I need the same code working for all other checkboxes outside the table. The email ids are fetched through android studio.

 $("#selectall").change(function () {
$("input:checkbox").prop('checked', $(this).prop("checked"));
});
jQuery(function($) {
var $checks = $('input:checkbox').change(function() {
if (this.checked) {
  $checks.filter('[value="' + this.value + '"]').not(this).prop('checked', this.checked);
}
})
})




Aucun commentaire:

Enregistrer un commentaire