X-Git-Url: http://git.datanom.net/qtadmin.git/blobdiff_plain/5c7b972ed26570d2bf4e092d937b81578e84c124..b4a9e00ed371c95536e74e700df60d6590413c45:/js/checkbox.js diff --git a/js/checkbox.js b/js/checkbox.js index d008803..0bdce8e 100644 --- a/js/checkbox.js +++ b/js/checkbox.js @@ -1,10 +1,10 @@ /* 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 { @@ -12,5 +12,16 @@ function checkAction() { } } } - 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; + } + } }