From 24961d28f8e9ad45bc0cceba3e37a86cdfedc232 Mon Sep 17 00:00:00 2001 From: phasefx Date: Thu, 17 Dec 2009 07:34:35 +0000 Subject: [PATCH] Perpetuating the evil of fancy_prompt, giving it the ability to discern required fields 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 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Open-ILS/xul/staff_client/chrome/content/util/fancy_prompt.xul b/Open-ILS/xul/staff_client/chrome/content/util/fancy_prompt.xul index 0579d5b975..8d32d89faa 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/fancy_prompt.xul +++ b/Open-ILS/xul/staff_client/chrome/content/util/fancy_prompt.xul @@ -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; -- 2.11.0