Problems with a checkbox in one column when i want to get all using js
Problems with a checkbox in one column when i want to get all using js
betita_elfica
Posts: 4Questions: 1Answers: 0
Hi,
I use this jquery table, in the last column i have a checkbox like this:
well, for each row i have a checkbox with id casella_X (x can be 1 to 16 if i have 16 rows). then i have a functino in javascript that catch all checkboxes for count the checked boxes, but when i have multiple pages i only can catch some checkboxes, all others says NULL.
how i can solve it? thanks
this is the javascript code:
function activarDesactivarButons(n){
var num=0;
for(i=1;i<=n;i++) {
//alert(document.getElementById('casella_'+i).value); (only shows few rows, not all rows)
//alert(document.getElementById('casella_'+i).checked); (only shows few rows, not all rows)
if(document.getElementById('casella_'+i).checked) {
num++;
}
}
}
I use this jquery table, in the last column i have a checkbox like this:
well, for each row i have a checkbox with id casella_X (x can be 1 to 16 if i have 16 rows). then i have a functino in javascript that catch all checkboxes for count the checked boxes, but when i have multiple pages i only can catch some checkboxes, all others says NULL.
how i can solve it? thanks
this is the javascript code:
function activarDesactivarButons(n){
var num=0;
for(i=1;i<=n;i++) {
//alert(document.getElementById('casella_'+i).value); (only shows few rows, not all rows)
//alert(document.getElementById('casella_'+i).checked); (only shows few rows, not all rows)
if(document.getElementById('casella_'+i).checked) {
num++;
}
}
}
This discussion has been closed.