function validateFormOnSubmit(theForm) {
var reason = "";

  reason += validateEmpty(theForm.street);
  reason += validateEmpty(theForm.city);
  reason += validateEmpty(theForm.zip);
      
  if (reason != "") {
    alert("All fields are required. Please fill in your street address, city and zip for your starting point.");
    return false;
  }

  return true;
}

function validateEmpty(fld) {
    var error = "";
 
    if (fld.value.length == 0) {
        fld.style.background = '#fdff5b'; 
        error = "true"
    } else {
        fld.style.background = 'White';
    }
    return error;  
}