1) Either surround the different tables with their seperate <form></form>, and change the javascript to something like:
Code:
function checkAll(table){
for (var i=0;i<document.forms[table].elements.length;i++)
{
var e=document.forms[table].elements[i];
if ((e.name != 'allbox') && (e.type=='checkbox'))
{
e.checked=document.forms[table].allbox.checked;
}
}
}
And in your allCheck box, call it with something accordingly like
Code:
...
<input type="checkbox" value="on" name="allbox" onclick="checkAll(0);"/>
...
<input type="checkbox" value="on" name="allbox" onclick="checkAll(1);"/>
...
Or name the checkboxes something which makes sence, like:
Code:
...
<input type=checkbox name=table1_1>
<input type=checkbox name=table1_2>
...
<input type=checkbox name=table2_1>
<input type=checkbox name=table2_2>
...
And modify the javascript code to something like:
Code:
function checkAll(table){
for (var i=0;i<document.forms[0].elements.length;i++)
{
var e=document.forms[0].elements[i];
if ((e.name.substring(0,table.length) == table) && (e.name != 'allbox') && (e.type=='checkbox'))
{
e.checked=document.forms[0].allbox.checked;
}
}
}
And then according to the table number, call it like:
Code:
<input type="checkbox" value="on" name="allbox" onclick="checkAll("table1");"/>
2) and 3) requires some server side scripting like PHP/MySQL solutions....