Perpetuating the evil of fancy_prompt, giving it the ability to discern required...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 17 Dec 2009 07:34:35 +0000 (07:34 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 17 Dec 2009 07:34:35 +0000 (07:34 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15181 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/util/fancy_prompt.xul

index 0579d5b..8d32d89 100644 (file)
                 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;