// function areAllReqFilled(formName)
// function: To see if all Required fields are filled out
// parameters: formName - the "name" value of the form
function areAllReqFilled(formName) {
if (areAllReqFilledGen(formName)){
return true;
} else {
return false;
}
}
function areAllReqFilledGen(formName){
alertMsg = "
";
errorCount = 0;
for (x=0; x' + ReqFieldsDisplayNames[x] + '';
errorCount++;
}
} else if (document.forms[formName].elements[ReqFieldsList[x]].type == "select-one") {
if (document.forms[formName].elements[ReqFieldsList[x]].selectedIndex == 0){
alertMsg += '- ' + ReqFieldsDisplayNames[x] + '
';
errorCount++;
}
} else if (document.forms[formName].elements[ReqFieldsList[x]].type == "hidden") {
// do nothing
} else {
if (getIndex(formName, ReqFieldsList[x]) == 0) {
alertMsg += '- ' + ReqFieldsDisplayNames[x] + '
';
errorCount++;
}
}
}
if (alertMsg != "") { // there are errors so call Alert and return false
alertMsg = allReqFields + '
' + alertMsg;
alertMsg += '
';
//figure out which Alert window to use
if (errorCount == 1) {
Alert(alertMsg);
} else if (errorCount <= 5) {
Alert1(alertMsg);
} else {
Alert2(alertMsg);
}
return false;
} else { // no errors so return true and allow parent form submission
return true;
}
}
function getIndex(formname, element){
var length = document.forms[formname].elements[element].length;
var checked = 0;
for (i=0; i