function checkEmail (strng) { var error=""; if (strng == "") { error = "You didn't enter an email address.\n"; } var emailFilter=/^.+@.+\..{2,3}$/; if (!(emailFilter.test(strng))) { error = "Please enter a valid email address.\n"; } else { //test email for illegal characters var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/; if (strng.match(illegalChars)) { error = "The email address contains illegal characters.\n"; } } return error; } function checkWholeForm(theForm) { //alert("checkWholeForm"); var why = ""; why += checkEmail(theForm.email.value); //why += checkPhone(theForm.phone.value); //why += checkPassword(theForm.password.value); //why += checkUsername(theForm.username.value); //why += isEmpty(theForm.name.value); //why += isEmptyTextBox(theForm.msg.value); //why += match(theForm.dept.value,theForm.location.value); //why += match(theForm.dept.value,theForm.phone.value); //why += isDifferent(theForm.different.value); //for (i=0, n=theForm.radios.length; i