Added Country question type to Survey

Refactored WebGUI::Form::Country so that it can be used to return a list of countries
This commit is contained in:
Patrick Donelan 2009-05-06 02:38:26 +00:00
parent a819c93944
commit 494efe1cf1
5 changed files with 205 additions and 288 deletions

View file

@ -30,6 +30,9 @@ if (typeof Survey === "undefined") {
var DATE_SHORT = {
'Year Month': 1
};
var COUNTRY = {
'Country': 1
};
var DATE_TYPES = {
'Date': 1,
'Date Range': 1
@ -643,6 +646,17 @@ if (typeof Survey === "undefined") {
continue;
}
if (COUNTRY[q.questionType]) {
for (var k = 0; k < q.answers.length; k++) {
var ans = q.answers[k];
if (toValidate[q.id]) {
toValidate[q.id].type = q.questionType;
toValidate[q.id].answers[ans.id] = 1;
}
}
continue;
}
if (DATE_TYPES[q.questionType]) {
for (var k = 0; k < q.answers.length; k++) {
var ans = q.answers[k];