[open-ils-commits] r15181 - trunk/Open-ILS/xul/staff_client/chrome/content/util (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Dec 17 02:34:39 EST 2009


Author: phasefx
Date: 2009-12-17 02:34:35 -0500 (Thu, 17 Dec 2009)
New Revision: 15181

Modified:
   trunk/Open-ILS/xul/staff_client/chrome/content/util/fancy_prompt.xul
Log:
Perpetuating the evil of fancy_prompt, giving it the ability to discern required fields

Modified: trunk/Open-ILS/xul/staff_client/chrome/content/util/fancy_prompt.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/util/fancy_prompt.xul	2009-12-17 05:58:50 UTC (rev 15180)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/util/fancy_prompt.xul	2009-12-17 07:34:35 UTC (rev 15181)
@@ -124,6 +124,13 @@
                 JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'});
                 if (ev.target.id) xulG[ ev.target.id ] = ev.target.value || ev.target.getAttribute('value');
                 xulG[ 'fancy_submit' ] = ev.target.value || ev.target.getAttribute('value');
+                var nl = document.getElementsByAttribute('name','fancy_required_data');
+                    for (var i = 0; i < nl.length; i++) {
+                    xulG[ nl[i].id ] = nl[i].nodeName == 'checkbox' ? nl[i].checked : nl[i].value;
+                    if ( xulG[ nl[i].id ] == '' ) {
+                        nl[i].focus(); return; // abort save
+                    }
+                }
                 var nl = document.getElementsByAttribute('name','fancy_data');
                     for (var i = 0; i < nl.length; i++) {
                     xulG[ nl[i].id ] = nl[i].nodeName == 'checkbox' ? nl[i].checked : nl[i].value;



More information about the open-ils-commits mailing list