2009-06-25 03:46:59 +00:00
|
|
|
|
2012-08-06 23:10:08 +02:00
|
|
|
M.mod_survey = {};
|
|
|
|
|
|
|
|
M.mod_survey.init = function(Y) {
|
2009-06-25 03:46:59 +00:00
|
|
|
if (document.getElementById('surveyform')) {
|
|
|
|
var surveyform = document.getElementById('surveyform');
|
2012-08-06 23:10:08 +02:00
|
|
|
Y.YUI2.util.Event.addListener('surveyform', "submit", function(e) {
|
|
|
|
var error = false;
|
|
|
|
if (document.getElementById('surveyform')) {
|
|
|
|
var surveyform = document.getElementById('surveyform');
|
|
|
|
for (var i=0; i < surveycheck.questions.length; i++) {
|
|
|
|
var tempquestion = surveycheck.questions[i];
|
|
|
|
if (surveyform[tempquestion['question']][tempquestion['default']].checked) {
|
|
|
|
error = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (error) {
|
|
|
|
alert(M.str.survey.questionsnotanswered);
|
|
|
|
Y.YUI2.util.Event.preventDefault(e);
|
|
|
|
return false;
|
|
|
|
} else {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
});
|
2009-06-25 03:46:59 +00:00
|
|
|
}
|
2012-08-06 23:10:08 +02:00
|
|
|
};
|