//validate email format function CheckEmail(src) { var emailPat=/^([a-zA-Z0-9\._-]+)@([a-zA-Z0-9\._-]+)$/; var matchArray=src.match(emailPat); if (matchArray==null) { /* Too many/few @'s or something; basically, this address doesn't even fit the general mould of a valid e-mail address. */ //alert("Email address seems incorrect (check @ and .'s)"); return false; } else{ var user=matchArray[1]; var domain=matchArray[2]; var userPat= /^(www\.)/; if(userPat.test(user)){ //alert("Can not have www. at the beginning of the e-mail address.Please try again."); return false; } } return true; } //validate the form function Validate(form){ //contact name if(form.file_name) { form.passed_file.value = form.file_name.value; } if (form.your_name.value == ""){ alert("You must enter a name."); form.your_name.focus(); form.your_name.select(); return false; } if ((form.email.value == "") || (!CheckEmail(form.email.value))){ alert("You must provide a valid e-mail address, in the format john@doe.com."); form.email.focus(); form.email.select(); return false; } if ((form.select_state.seletedIndex == -1) || form.select_state.options[form.select_state.selectedIndex].value == ""){ alert("You must select a state."); form.select_state.focus(); return false; } if ((form.type_of_user.seletedIndex == -1) || form.type_of_user.options[form.type_of_user.selectedIndex].value == ""){ alert("You must select a type of user."); form.type_of_user.focus(); return false; } if ((form.subject.seletedIndex == -1) || form.subject.options[form.subject.selectedIndex].value == ""){ alert("You must select a subject heading."); form.subject.focus(); return false; } } function ResetForm() {document.forms['customer_service_confirmation.cfm'].reset();}