// this function is called when the user hits the submit button // for the candidate information email form // and it returns true to finish the submit and false to stop function ValidateCandidateInfoForm( form ) { // Check the required fields from top to bottom if ( form.name.value == "" ) { alert("Please enter your name before hitting the 'Send Information' button."); return false; } else if ( form.city.value == "" ) { alert("Please enter your city or town before hitting the 'Send Information' button."); return false; } else if ( form.phone.value == "" ) { alert("Please enter your phone before hitting the 'Send Information' button."); return false; } // Now validate the email address the user supplied if ( ! ValidateEmailAddress( form, "Send Information" ) ) { return false; } return true; }