
function checkFieldsApps() {
missinginfo = "";

//normal textfield//
if (document.apps.firstname.value == "") {
missinginfo += "\n     -  child's first name";
}
if (document.apps.lastname.value == "") {
missinginfo += "\n     -  child's last name";
}
if (document.apps.parent1.value == "") {
missinginfo += "\n     -  parent's name";
}
if (document.apps.street.value == "") {
missinginfo += "\n     -  street";
}
if (document.apps.city.value == "") {
missinginfo += "\n     -  city";
}
if (document.apps.zip.value == "") {
missinginfo += "\n     -  zip code";
}
if (document.apps.phone.value == "") {
missinginfo += "\n     -  home phone number";
}

//email check//
if ((document.apps.email1.value == "") || 
(document.apps.email1.value.indexOf('@') == -1) || 
(document.apps.email1.value.indexOf('.') == -1)) {
missinginfo += "\n     -  email address";
}

//select list with first option value="0"//
if (document.apps.mm.value == "0") {
missinginfo += "\n     -  birth month";
}
if (document.apps.dd.value == "0") {
missinginfo += "\n     -  birth month";
}
if (document.apps.yy.value == "0") {
missinginfo += "\n     -  birth year";
}
if (document.apps.child_lang.value == "0") {
missinginfo += "\n     -  child's language exposure";
}

//radio button and checkboxes// 
if ( (!programChecked()) ) {
missinginfo += "\n     -  program";
}
if ( (!genderChecked()) ) {
missinginfo += "\n     -  gender";
}
if ( (!morningsChecked()) ) {
missinginfo += "\n     -  mornings";
}
if ( (!xChecked()) ) {
missinginfo += "\n     -  mornings unable to attend";
}
if ( (!vChecked()) ) {
missinginfo += "\n     -  mornings unable to volunteer";
}

//output//
if (missinginfo != "") {
missinginfo ="\n" +
"You did not fill in the:\n" +
missinginfo + "\n" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else return true;
}

//function for radio buttons and checkboxes//
function programChecked() {
  for (i=0; i<document.apps.program.length; i++) {
    if (document.apps.program[i].checked) {
      return true;
    }
  }
  return false;
}

function genderChecked() {
  for (i=0; i<document.apps.gender.length; i++) {
    if (document.apps.gender[i].checked) {
      return true;
    }
  }
  return false;
}

function morningsChecked() {
  for (i=0; i<document.apps.mornings.length; i++) {
    if (document.apps.mornings[i].checked) {
      return true;
    }
  }
  return false;
}

function xChecked() {
    if ((document.apps.x1.checked) || (document.apps.x2.checked) || (document.apps.x3.checked) || (document.apps.x4.checked) || (document.apps.x5.checked) || (document.apps.x6.checked)) {
      return true;
    }
  return false;
}

function vChecked() {
    if ((document.apps.v1.checked) || (document.apps.v2.checked) || (document.apps.v3.checked) || (document.apps.v4.checked) || (document.apps.v5.checked) || (document.apps.v6.checked)) {
      return true;
    }
  return false;
}
 
