// Executive Systems Survey Form Validation (updated 5/3/00)
<!--
function validate() {

// Name Field
  document.survey.elements[2].focus();
  var name = document.survey.elements[2].value;
  if (name == "" || name == " ") {
    alert("\nName field is blank.\n\nPlease enter your name.");
    return false;
  }
  for (var i = 0; i < name.length; i++) {
    var ch = name.substring(i, i + 1);
    if (((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && ch != ' ') {
      alert("\nName field accepts only letters and spaces.\n\nPlease re-enter your name.");
      return false;
    }
  }

// Email Address Field
  document.survey.elements[3].focus();
  var email = document.survey.elements[3].value;
  if (email == "" || email == " ") {
    alert("\nEmail Address is blank.\n\nPlease enter your email.");
    return false;
  }
  if (document.survey.elements[3].value.indexOf ('@',0) == -1 || document.survey.elements[3].value.indexOf ('.',0) == -1) {
    alert("\nEmail Address requires a \"@\" and \".\"\n\nPlease re-enter a valid email address.");
    return false;
  }

// City Field
  document.survey.elements[4].focus();
  var city = document.survey.elements[4].value;
  if (city == "" || city == " ") {
    alert("\nCity field is blank.\n\nPlease enter your city.");
    return false;
  }
  for (var i = 0; i < city.length; i++) {
    var ch = city.substring(i, i + 1);
    if (((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && ch != ' ') {
      alert("\nCity field accepts only letters and spaces.\n\nPlease re-enter your city.");
      return false;
    }
  }

// State Field
  document.survey.elements[5].focus();
  var state = document.survey.elements[5].value;
  if (state == "") {
    alert("\nPlease enter your state.");
    return false;
  }

// Salary Field
  document.survey.elements[22].focus();
  var salary = document.survey.elements[22].value;
  if (salary == "" || salary == " ") {
    alert("\nSalary field is blank.\n\nPlease enter the salary.");
    return false;
  }
  for (var i = 0; i < salary.length; i++) {
    var no = salary.substring(i, i + 1);
    if (no < "0" || "9" < no) {
      alert("\nSalary must be an integer.\n\nPlease re-enter the salary.");
      return false;
    }
  }

  document.survey.elements[26].focus();

}
//-->