// Copyright (c) 2009, John Altenmueller -- john@altenmueller.com // You may freely use and redistribute this code under the terms // of the BSD license: http://creativecommons.org/licenses/BSD/ 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; } // non-empty textbox function isEmpty(strng, name) { var error = ""; if (strng.length === 0) { error = "You did not enter " + name + ".\n"; } return error; } // valid selector from dropdown list function checkDropdown(choice, name) { var error = ""; if (choice === 0) { error = "You did not enter " + name + ".\n"; } return error; } function checkRadio(radio, name) { var error = ""; var checkvalue = 0; for (var i=0, n=radio.length; i