sanity check
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 3 Aug 2006 19:36:58 +0000 (19:36 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 3 Aug 2006 19:36:58 +0000 (19:36 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5257 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/patron/ue.js

index c7447bf..b0bb8f7 100644 (file)
@@ -385,21 +385,26 @@ function uEditGetErrorStrings() {
 
        /* munge up something for all of the required surveys 
                (which are not registered with the fields) */
-       var rows = $('ue_survey_table').getElementsByTagName('tr');
        if( patron.isnew() ) {
-               for( var r in rows ) {
-       
-                       var row = rows[r];
-                       var sel = $n(row, 'ue_survey_answer');
-                       if(!sel) continue;
-                       var qstn = row.getAttribute('question');
-       
-                       if(qstn) {
-                               qstn            = surveyQuestionsCache[qstn];
-                               survey  = surveysCache[qstn.survey()];
-                               var val = getSelectorVal(sel);
-                               if(!val && isTrue(survey.required()))
-                                       errors.push($('ue_bad_survey').innerHTML + ' : ' + qstn.question());
+               var sel = $('ue_survey_table');
+
+               if( sel ) {
+                       var rows = sel.getElementsByTagName('tr');
+
+                       for( var r in rows ) {
+               
+                               var row = rows[r];
+                               var sel = $n(row, 'ue_survey_answer');
+                               if(!sel) continue;
+                               var qstn = row.getAttribute('question');
+               
+                               if(qstn) {
+                                       qstn            = surveyQuestionsCache[qstn];
+                                       survey  = surveysCache[qstn.survey()];
+                                       var val = getSelectorVal(sel);
+                                       if(!val && isTrue(survey.required()))
+                                               errors.push($('ue_bad_survey').innerHTML + ' : ' + qstn.question());
+                               }
                        }
                }
        }