I would like to send some data from checkbox, so I wrote this:
while($entry = readdir($fp)) {
$fullPath = $currentDir.$entry;
print "<tr>td><input type='checkbox' name='selectedEntry[]' value='".$fullPath."'></td>";
}
I used 'selectedEntry' for my checkbox so that I could some multi data to another php. But the problem is: How could I check if any single checkbox has been checked? I tried to write this in javascript:
<script language='javascript'>
if (myForm.selectedEntry.length == 0) {
alert("You have to select at least one item");
}
</script>
And also how could I make a "Select All"?
I tried to write this:
for (var i=0;i<myForm.selectedEntry.length ; i++) {
myForm.selectedEntry.checked = true;
}
But none of my script work. How can I do these?
Thanks.