fixed sometimes (or some-browser) not working toggle_all

This commit is contained in:
Ralf Becker 2006-09-24 16:52:15 +00:00
parent bdb15819bd
commit 78735f5cf1

View File

@ -123,17 +123,18 @@ function toggle_all(form,name)
} }
else else
{ {
for (var i = 0; i < form.elements[name].length; i++) var checkboxes = document.getElementsByName(name);
for (var i = 0; i < checkboxes.length; i++)
{ {
if (!form.elements[name][i].checked) if (!checkboxes[i].checked)
{ {
all_set = false; all_set = false;
break; break;
} }
} }
for (var i = 0; i < form.elements[name].length; i++) for (var i = 0; i < checkboxes.length; i++)
{ {
form.elements[name][i].checked = !all_set; checkboxes[i].checked = !all_set;
} }
} }
} }