So, I've got this code:
PHP
if($row['accept']==1){
echo "<input type=\"checkbox\" name=\"check[".$row['id']."]\" value=\"0\">Decline";
}
else{
echo "<input type=\"checkbox\" name=\"check[".$row['id']."]\" value=\"1\">Accept";
}
JavaScript
function do_this(c){
var checkboxes = document.getElementsByName('check[]');
var checkAll = document.getElementById('checkAll');
var v=gid(c);
if(checkAll.value == 'select'){
for (var i in checkboxes){
checkboxes[i].checked = '';
v.style.display="none";
}
checkAll.value = 'deselect';
}else{
for (var i in checkboxes){
checkboxes[i].checked = 'true';
v.style.display="inline";
}
checkAll.value = 'select';
}
}
I need to get the name from the input checkboxes, and get it with the document.getElementsByName('the name needs to be here'). But I don't know how to write the name form the checkbox in the Java function. Is there a posibility to do this? Thank you in advance!