// validates the contact form re=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/ function validForm(downloadit){ // test name if (downloadit.formname.value == "") { alert("Please enter a name") downloadit.formname.focus() return false } // test email address if (downloadit.formemail.value == "") { alert("Please enter an email address") downloadit.formemail.focus() return false } //verify email address if (downloadit.verifyemail.value != downloadit.formemail.value) { alert("Please ensure both email addresses match") downloadit.verifyemail.focus() return false } // test validity of email address if (!re.test(downloadit.formemail.value)) { alert("Invalid email address!") downloadit.formemail.focus() return false } return true }