I've got a form that allows for deletion of multiple comments.
In my HTML, it looks like this..
Code: Select all
<input type="checkbox" name="cdelete[18]">
<input type="checkbox" name="cdelete[19]">
<input type="checkbox" name="cdelete[20]">I can do it fine if the name was just cdelete.. but then I couldn't process multiple checked items.
My current javascript looks like this:
Code: Select all
function checkAll()
{
var cd = document.cdeleteform.cdelete;
if (cd.length)
{
for (i=0; i<cd.length; i++)
{
cd[i].checked = true;
}
}
}