Reputation: 2773
I have a jquery datatable in this fiddle with check boxes and dropdown selector. I am counting the checked checkboxes as,
function updateCount () {
count = $("input[name='check']:checked").length;
agebelow = $(".AgeSelect option:selected[name='below']").length;
ageabove = $(".AgeSelect option:selected[name='above']").length;
$("#count").text(count);
if (count > 0) {
$("#status").toggle(count > 0);
}
$('#count2').text(agebelow);
if ( agebelow > 0 ) {
$("#status2").toggle(agebelow > 0);
}
$('#count1').text(ageabove);
if ( ageabove > 0 ) {
$("#status1").toggle(ageabove > 0);
}
};
The counter working fine in first page of data table. But in other pages the counter not updating when i checked a checkbox. The same is applied to the dropdown also. So how can I fix this issue?
Upvotes: 1
Views: 1329