From 86998568e0a42f729dc558abb3ce81fb6302549b Mon Sep 17 00:00:00 2001 From: erickson Date: Thu, 3 Aug 2006 19:36:58 +0000 Subject: [PATCH] sanity check 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 | 33 +++++++++++++++------------ 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/patron/ue.js b/Open-ILS/xul/staff_client/server/patron/ue.js index c7447bfda1..b0bb8f7a3f 100644 --- a/Open-ILS/xul/staff_client/server/patron/ue.js +++ b/Open-ILS/xul/staff_client/server/patron/ue.js @@ -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()); + } } } } -- 2.11.0