function checkOptOutForm(formname) { // Checks for illegal characters in each text field for (i=0; i < eval('document.' + formname + '.length') ; i++) { if (eval('document.' + formname + '.elements[' + i + '].type') == "text" || eval('document.' + formname + '.elements[' + i + '].type') == "textarea") { stringer = eval('document.' + formname + '.elements[' + i + '].value'); } else { stringer = ""; } if ((stringer.indexOf("<") != -1)||(stringer.indexOf(">") != -1)) { alert('Sorry, but you have entered illegal characters (< or >) into this form.'); eval('document.' + formname + '.elements[' + i + '].focus()'); return false; } if ((stringer.indexOf("'") != -1)||(stringer.indexOf("\"") != -1)) { alert('Please do not enter single or double quotes into this form.'); eval('document.' + formname + '.elements[' + i + '].focus()'); return false; } if ((stringer.indexOf("(") != -1)||(stringer.indexOf(")") != -1)) { alert('Please do not enter parenthesis into this form.'); eval('document.' + formname + '.elements[' + i + '].focus()'); return false; } } // Checks to make sure the first name field isn't blank and accepts only letters var firstname = eval('document.' + formname + '.firstname.value'); if (firstname == "") { alert("Please enter your First Name."); eval('document.' + formname + '.firstname.focus()'); return false; } else { for (i=1;i255) { alert("Please complete or correct your e-mail address. (Fix any symbols or spaces.)") document.outform.email.focus(); return false; } } return } var domainArray=domain.match(domainPat) if (domainArray==null) { alert("Please complete or correct your e-mail address. (Fix any symbols or spaces.)") document.outform.email.focus(); return false; } // checking for valid .com, .org, etc. var atomPat=new RegExp(atom,"g") var domArr=domain.match(atomPat) var len=domArr.length if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>3) { alert("Please complete or correct your e-mail address. (Fix any symbols or spaces.)") document.outform.email.focus(); return false; } if (len<2) { var errStr="This address is missing a hostname." alert("Please complete or correct your e-mail address. (Fix any symbols or spaces.)") document.outform.email.focus(); return false; } } function checkForm(formname) { // Checks for illegal characters in each text field for (i=0; i < eval('document.' + formname + '.length') ; i++) { if (eval('document.' + formname + '.elements[' + i + '].type') == "text" || eval('document.' + formname + '.elements[' + i + '].type') == "textarea") { stringer = eval('document.' + formname + '.elements[' + i + '].value'); } else { stringer = ""; } if ((stringer.indexOf("<") != -1)||(stringer.indexOf(">") != -1)) { alert('Sorry, but you have entered illegal characters (< or >) into this form.'); eval('document.' + formname + '.elements[' + i + '].focus()'); return false; } if ((stringer.indexOf("'") != -1)||(stringer.indexOf("\"") != -1)) { alert('Please do not enter single or double quotes into this form.'); eval('document.' + formname + '.elements[' + i + '].focus()'); return false; } if ((stringer.indexOf("(") != -1)||(stringer.indexOf(")") != -1)) { alert('Please do not enter parenthesis into this form.'); eval('document.' + formname + '.elements[' + i + '].focus()'); return false; } } // Checks to make sure the first name field isn't blank and accepts only letters var firstname = eval('document.' + formname + '.firstname.value'); if (firstname == "") { alert("Please enter your First Name."); eval('document.' + formname + '.firstname.focus()'); return false; } else { for (i=1;i 1) || ((zip.length==10) && ""+zip.charAt(5)!="-")) { alert("The hyphen character should be used with a properly formatted 5 digit+four zip code, like '12345-6789'. Please try again."); eval('document.' + formname + '.zip.focus()'); return false; } } } var area = eval('document.' + formname + '.area.value'); if (area == "") { alert("Please enter your area code."); eval('document.' + formname + '.area.focus()'); return false; } var valid = "0123456789"; for (var i=0; i < area.length; i++) { temp = "" + area.substring(i, i+1); if (valid.indexOf(temp) == "-1") { alert("Your phone number cannot contain non-numeric values. Please complete or correct the information."); eval('document.' + formname + '.area.focus()'); return false; } } var exch = eval('document.' + formname + '.exch.value'); var phone = eval('document.' + formname + '.phone.value'); if ((exch == "") || (phone == "")) { alert("Please enter your phone number."); eval('document.' + formname + '.exch.focus()'); return false; } var valid = "0123456789"; for (var i=0; i < exch.length; i++) { temp = "" + exch.substring(i, i+1); if (valid.indexOf(temp) == "-1") { alert("Your phone number cannot contain non-numeric values. Please complete or correct the information."); eval('document.' + formname + '.exch.focus()'); return false; } } var valid = "0123456789"; for (var i=0; i < phone.length; i++) { temp = "" + phone.substring(i, i+1); if (valid.indexOf(temp) == "-1") { alert("Your phone number cannot contain non-numeric values. Please complete or correct the information."); eval('document.' + formname + '.phone.focus()'); return false; } } var phonenumber = area + exch + phone; if (phonenumber.length!=10) { alert ("Please correct your phone number."); eval('document.' + formname + '.area.focus()'); return false; } // Checks to make sure the e-mail address is valid and not blank var email = eval('document.' + formname + '.email.value'); if (email == "") { alert("Please enter your E-mail address"); eval('document.' + formname + '.email.focus()'); return false; } var emailStr = document.regform.email.value; var emailPat = /^(.+)@(.+)$/ var specialChars = "\\(\\)<>@,;:\\\\\\\"\\.\\[\\]" var validChars = "\[^\\s" + specialChars + "\]" var quotedUser = "(\"[^\"]*\")" var ipDomainPat = /^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/ var atom = validChars + '+' var word = "(" + atom + "|" + quotedUser + ")" var userPat = new RegExp("^" + word + "(\\." + word + ")*$") var domainPat = new RegExp("^" + atom + "(\\." + atom +")*$") var matchArray = emailStr.match(emailPat) if (emailStr == "") { alert("Please complete or correct your e-mail address. (Fix any symbols or spaces.)"); document.regform.email.focus(); return false; } // check for @ and . if (matchArray == null) { alert("Please complete or correct your e-mail address. (Fix any symbols or spaces.)") document.regform.email.focus(); return false; } var user = matchArray[1] var domain = matchArray[2] var IPArray = domain.match(ipDomainPat) if (IPArray!=null) { for (var i=1;i<=4;i++) { if (IPArray[i]>255) { alert("Please complete or correct your e-mail address. (Fix any symbols or spaces.)") document.regform.email.focus(); return false; } } return } var domainArray=domain.match(domainPat) if (domainArray==null) { alert("Please complete or correct your e-mail address. (Fix any symbols or spaces.)") document.regform.email.focus(); return false; } // checking for valid .com, .org, etc. var atomPat=new RegExp(atom,"g") var domArr=domain.match(atomPat) var len=domArr.length if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>3) { alert("Please complete or correct your e-mail address. (Fix any symbols or spaces.)") document.regform.email.focus(); return false; } if (len<2) { var errStr="This address is missing a hostname." alert("Please complete or correct your e-mail address. (Fix any symbols or spaces.)") document.regform.email.focus(); return false; } }