matchArray[2] // See if "user" is valid if (user.match(userPat)==null) { // user is not valid alert("The Email username doesn't seem to be valid. Did you use a space or an incorrect character?") return false } var IPArray=domain.match(ipDomainPat) if (IPArray!=null) { // this is an IP address for (var i=1;i<=4;i++) { if (IPArray[i]>255) { alert("Your Email Destination IP address is invalid. Please check your address.") return false } } return true } // Domain is symbolic name var domainArray=domain.match(domainPat) if (domainArray==null) { alert("Your Email domain name doesn't seem to be valid. Please check your address.") return false } 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>4) { // the address must end in a two letter or three letter word. alert("Your Email address must end in a three-letter or a four-letter domain, or a two letter country.") return false } // Make sure there's a host name preceding the domain. if (len<2) { var errStr="Your Email address is missing a hostname, such as .com .net .org." alert(errStr) return false } //Checking other fields too!! if (theForm.Phone.value == "") { alert("Please enter your Phone Number in the \"Phone\" field. Thank you."); theForm.Phone.focus(); return (false); } // If we've gotten this far, everything's valid! return true; } // End -->