[Fusionforge-commits] r10508 - trunk/src/www/js

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Thu Sep 16 21:04:39 CEST 2010


Author: aljeux
Date: 2010-09-16 21:04:39 +0200 (Thu, 16 Sep 2010)
New Revision: 10508

Modified:
   trunk/src/www/js/common.js
Log:
Add flipAll() js func to allow dynamic javascript switching.

Modified: trunk/src/www/js/common.js
===================================================================
--- trunk/src/www/js/common.js	2010-09-16 19:04:25 UTC (rev 10507)
+++ trunk/src/www/js/common.js	2010-09-16 19:04:39 UTC (rev 10508)
@@ -57,3 +57,15 @@
     elemdisp2.style.display='block'
   }
 }
+
+function flipAll(formObj) {
+  var isFirstSet = -1;
+  for (var i=0; i < formObj.length; i++) {
+      fldObj = formObj.elements[i];
+      if ((fldObj.type == 'checkbox') && (fldObj.name.substring(0,2) == 'p[')) {
+         if (isFirstSet == -1)
+           isFirstSet = (fldObj.checked) ? true : false;
+         fldObj.checked = (isFirstSet) ? false : true;
+       }
+   }
+}




More information about the Fusionforge-commits mailing list