diff templates/classic/html/help_controls.js @ 3044:72399c7c9bcc maint-0.7

merge from HEAD
author Richard Jones <richard@users.sourceforge.net>
date Tue, 04 Jan 2005 01:08:52 +0000
parents 37bf760544f3
children
line wrap: on
line diff
--- a/templates/classic/html/help_controls.js	Mon Jan 03 23:02:27 2005 +0000
+++ b/templates/classic/html/help_controls.js	Tue Jan 04 01:08:52 2005 +0000
@@ -13,21 +13,33 @@
 }
 
 function determineList() {
-    // generate a comma-separated list of the checked items
-    var list = new String('');
-    for (box=0; box < document.frm_help.check.length; box++) {
-        if (document.frm_help.check[box].checked) {
-            if (list.length == 0) {
-                separator = '';
-            }
-            else {
-                separator = ',';
-            }
-            // we used to use an Array and push / join, but IE5.0 sux
-            list = list + separator + document.frm_help.check[box].value;
-        }
-    }
-    return list;
+     // generate a comma-separated list of the checked items
+     var list = new String('');
+ 
+     // either a checkbox object or an array of checkboxes
+     var check = document.frm_help.check;
+ 
+     if ((check.length == undefined) && (check.checked != undefined)) {
+         // only one checkbox on page
+         if (check.checked) {
+             list = check.value;
+         }
+     } else {
+         // array of checkboxes
+         for (box=0; box < check.length; box++) {
+             if (check[box].checked) {
+                 if (list.length == 0) {
+                     separator = '';
+                 }
+                 else {
+                     separator = ',';
+                 }
+                 // we used to use an Array and push / join, but IE5.0 sux
+                 list = list + separator + check[box].value;
+             }
+         }
+     }
+     return list;  
 }
 
 function updateList() {

Roundup Issue Tracker: http://roundup-tracker.org/