mirror of
https://github.com/WordPress/WordPress.git
synced 2024-08-23 06:13:29 +02:00
git-svn-id: http://svn.automattic.com/wordpress/trunk@7371 1a063a9b-81f0-0310-95a4-ce76da25c4cd
31 lines
807 B
JavaScript
31 lines
807 B
JavaScript
function checkAll(form) {
|
|
for (i = 0, n = form.elements.length; i < n; i++) {
|
|
if(form.elements[i].type == "checkbox" && !(form.elements[i].getAttribute('onclick',2))) {
|
|
if(form.elements[i].checked == true)
|
|
form.elements[i].checked = false;
|
|
else
|
|
form.elements[i].checked = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
function getNumChecked(form) {
|
|
var num = 0;
|
|
for (i = 0, n = form.elements.length; i < n; i++) {
|
|
if (form.elements[i].type == "checkbox") {
|
|
if (form.elements[i].checked == true)
|
|
num++;
|
|
}
|
|
}
|
|
return num;
|
|
}
|
|
|
|
function checkAllUsers(role) {
|
|
var checkboxs = document.getElementsByTagName('input');
|
|
for(var i = 0, inp; inp = checkboxs[i]; i++)
|
|
if(inp.type.toLowerCase() == 'checkbox' && inp.className == role)
|
|
if(inp.checked == false)
|
|
inp.checked = true;
|
|
else
|
|
inp.checked = false;
|
|
} |