﻿//onsubmit="return checkWholeForm(survey);" - Place into formfunction checkWholeForm(survey) {    var why = "";    why += checkemail(survey.email.value);    why += isEmpty1(survey.name.value);    why += isEmpty2(survey.company.value);    why += isEmpty3(survey.address.value);    why += isEmpty4(survey.city.value);     why += isEmpty5(survey.state.value);    why += isEmpty6(survey.zip.value);                      why += checkphone(survey.phone.value);    if (why != "") {       alert(why);       return false;    }return true;}// Name Checkfunction isEmpty1(strng) {var error = "";  if (strng.length == 0) {     error = "Please provide us with your name\n"  }return error;     }// Company Checkfunction isEmpty2(strng) {var error = "";  if (strng.length == 0) {     error = "Please provide us with your company.\n"  }return error;     }// Address Checkfunction isEmpty3(strng) {var error = "";  if (strng.length == 0) {     error = "Please provide us with your address.\n"  }return error;     }// City Checkfunction isEmpty4(strng) {var error = "";  if (strng.length == 0) {     error = "Please provide us with your city.\n"  }return error;     }// State Checkfunction isEmpty5(strng) {var error = "";  if (strng.length == 0) {     error = "Please provide us with your state.\n"  }return error;     }// Zip Checkfunction isEmpty6(strng) {var error = "";  if (strng.length == 0) {     error = "Please provide us with your zip code.\n"  }return error;     }// Email Checkfunction checkemail (strng) {var error="";if (strng == "") {   error = "Please enter a email address.\n";}    var emailFilter=/^.+@.+\..{2,3}$/;    if (!(emailFilter.test(strng))) {        error = "Please enter a valid email address.\n";    }    else {//test email for illegal characters       var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/         if (strng.match(illegalChars)) {          error = "This is not a true email address.\n";       }    }return error;    }// Phone Checkfunction checkphone (strng) {var error = "";if (strng == "") {   error = "You didn't enter a phone number.\n";}var stripped = strng.replace(/[\(\)\.\-\ ]/g, ''); //strip out acceptable non-numeric characters    if (isNaN(parseInt(stripped))) {       error = "The phone number contains illegal characters.";      }    if (!(stripped.length == 10)) {        error = "The phone number is the wrong length. Make sure you included an area code.\n";    } return error;}