%@LANGUAGE="VBSCRIPT"%> <% function TestCaptcha(byval valSession, byval valCaptcha) dim tmpSession valSession = Trim(valSession) valCaptcha = Trim(valCaptcha) if (valSession = vbNullString) or (valCaptcha = vbNullString) then TestCaptcha = false else tmpSession = valSession valSession = Trim(Session(valSession)) Session(tmpSession) = vbNullString if valSession = vbNullString then TestCaptcha = false else valCaptcha = Replace(valCaptcha,"i","I") if StrComp(valSession,valCaptcha,1) = 0 then TestCaptcha = true else TestCaptcha = false end if end if end if end function function Validate() Dim strFirstName,strLastName,strTitle, strCompany,strAddress1,strAddress2,strCity,strState,strDepartment, strCountry, strPhone, strEmail, strComments,strIndustrySeg, flag strName= Request("txtFirstName") strLastName=Request("txtLastName") strCompany= Request("txtCompany") strtDepartment=Request("txtDepartment") strAddress1=Request("txtAddress1") strAddress2=Request("txtAddress2") strCity=Request("txtCity") strState=Request("txtState") stringZip=Request("txtZip") strPhone= Request("txtPhone") strEmail= Request("txtEmail") flag=0 if strName="" then Response.Write("") flag=1 End if if strLastName="" then Response.Write("") flag=1 End if if strCompany="" then Response.Write("") flag=1 End if if strtDepartment="" then Response.Write("") flag=1 End if if strAddress1="" then Response.Write("") flag=1 End if if strCity="" then Response.Write("") flag=1 End if if strState="" then Response.Write("") flag=1 End if if stringZip="" then Response.Write("") flag=1 else dim isValidz dim regExZ isValidz = True set regExZ = New RegExp regExZ.IgnoreCase = False regExZ.Pattern = "^\d+$" isValidz = regExZ.Test(stringZip) if not isValidz then Response.Write("") flag=1 else if Len(stringZip)>6 or Len(stringZip)<5 then Response.Write("") flag=1 End if End if End if if strEmail="" then Response.Write("") flag=1 else dim isValidE dim regEx isValidE = True set regEx = New RegExp regEx.IgnoreCase = False regEx.Pattern = "^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$" isValidE = regEx.Test(strEmail) if not isValidE then Response.Write("") flag=1 End if End if if flag=1 then Response.Write("") Validate=false else Validate=true End if end function %>