Followup patch to the first listed in https://bugs.launchpad.net/evergreen/+bug/745123
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 3 May 2011 15:03:59 +0000 (15:03 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 3 May 2011 15:03:59 +0000 (15:03 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@20382 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/ui/default/actor/user/register.js

index f0cad18..e4dc715 100644 (file)
@@ -652,13 +652,16 @@ function loadSurveys() {
     // draw surveys
     for(var idx in surveys) {
         var survey = surveys[idx];
     // draw surveys
     for(var idx in surveys) {
         var survey = surveys[idx];
+        var required = openils.Util.isTrue(survey.required());
         var srow = surveyTemplate.cloneNode(true);
         var srow = surveyTemplate.cloneNode(true);
+        if(required) srow.setAttribute('required','required');
         tbody.appendChild(srow);
         getByName(srow, 'name').innerHTML = survey.name();
 
         for(var q in survey.questions()) {
             var quest = survey.questions()[q];
             var qrow = surveyQuestionTemplate.cloneNode(true);
         tbody.appendChild(srow);
         getByName(srow, 'name').innerHTML = survey.name();
 
         for(var q in survey.questions()) {
             var quest = survey.questions()[q];
             var qrow = surveyQuestionTemplate.cloneNode(true);
+            if(required) qrow.setAttribute('required','required');
             tbody.appendChild(qrow);
             getByName(qrow, 'question').innerHTML = quest.question();
 
             tbody.appendChild(qrow);
             getByName(qrow, 'question').innerHTML = quest.question();
 
@@ -666,7 +669,7 @@ function loadSurveys() {
             var store = new dojo.data.ItemFileReadStore(
                 {data:fieldmapper.asva.toStoreData(quest.answers())});
             var select = new dijit.form.FilteringSelect({store:store,scrollOnFocus:false}, span);
             var store = new dojo.data.ItemFileReadStore(
                 {data:fieldmapper.asva.toStoreData(quest.answers())});
             var select = new dijit.form.FilteringSelect({store:store,scrollOnFocus:false}, span);
-            if (! openils.Util.isTrue(survey.required())) {
+            if (! required ) {
                 select.isValid = function() { return true; };
             }
             select.labelAttr = 'answer';
                 select.isValid = function() { return true; };
             }
             select.labelAttr = 'answer';