From 78735f5cf1a24db211233a374b91fc3f3104d62e Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 24 Sep 2006 16:52:15 +0000 Subject: [PATCH] fixed sometimes (or some-browser) not working toggle_all --- etemplate/js/etemplate.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/etemplate/js/etemplate.js b/etemplate/js/etemplate.js index df8e027c19..cac903a5b8 100644 --- a/etemplate/js/etemplate.js +++ b/etemplate/js/etemplate.js @@ -123,17 +123,18 @@ function toggle_all(form,name) } 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; 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; } } }