Get all checked checkboxes in the datatable
Get all checked checkboxes in the datatable
Danielss89
Posts: 2Questions: 0Answers: 0
Hi,
I have a table with some data, and a checkbox in each row.
Now each have a value, and when a user changes a selectbox og want the values of the checked checkboxes.
This is what i've got:
[code]$(".checkboxId").each(function(){
$("input:checked", table.fnGetNodes()).each(function(){
console.log($(this).val());
});
});[/code]
But if i just check one checkbox, the value of that checkbox is logged x times(x beeing the total number of checkboxes).
I have a table with some data, and a checkbox in each row.
Now each have a value, and when a user changes a selectbox og want the values of the checked checkboxes.
This is what i've got:
[code]$(".checkboxId").each(function(){
$("input:checked", table.fnGetNodes()).each(function(){
console.log($(this).val());
});
});[/code]
But if i just check one checkbox, the value of that checkbox is logged x times(x beeing the total number of checkboxes).
This discussion has been closed.
Replies
[code]
$("input:checked", table.fnGetNodes()).each(function(){
console.log($(this).val());
});
[/code]
Allan
Thx :)
$("input:checked", table.fnGetNodes()).each(function(){
console.log($(this).val());
});
How can I return The Row ID for each item checked?