/* vim: set ts=4 tw=4 sw=4 noet: */
-function checkAction() {
+function checkAction(action) {
var ids = '';
var c = document.getElementsByName('action');
for (var i = 0; i < c.length; i++) {
- if (c[i].type == 'checkbox' and c[i].checked == true) {
+ if (c[i].type == 'checkbox' && c[i].checked == true) {
if (ids == '') {
ids = c[i].value;
} else {
}
}
}
- alert(ids);
+ var url = 'quarantine.php?op=' + action + '&id=' + ids;
+ location.href=url;
+}
+
+function updateAction(chkBtn) {
+ var checked = chkBtn.checked;
+ var c = document.getElementsByName('action');
+ for (var i = 0; i < c.length; i++) {
+ if (c[i].type == 'checkbox' && c[i].checked != checked) {
+ c[i].checked = checked;
+ }
+ }
}