Hi
I'm writing some basic server-side validation - must be vbscript
I'd like to incorporate within the code below a password checker for fields Pass1 and Pass2 i.e. they must be at least 6 characters, no spaces, at least one number and of course must match + anything else I've forgot !
I also could do with an email validator to fit in below
any help much appreciated
thanks
If Request.Form.Count > 0 Then
OrganisationName = Request.Form("Org_Name")
OrganisationType = Request.Form("Org_Type")
PostCode = Request.Form("PostCode")
Address = Request.Form("Address1_1")
Password = request.form("Pass1")
Password1 = request.form("Pass2")
If OrganisationName = "" Then
ErrorMsg1 = ErrorMsg11 & "Please enter your Organisation Name<br>"
End If
If OrganisationType = "" Then
ErrorMsg1 = ErrorMsg1 & "Please enter an Organisation type<br>"
End If
If PostCode = "" Then
ErrorMsg1 = ErrorMsg1 & "Please enter a PostCode<br>"
End If
If Address = "" Then
ErrorMsg1 = ErrorMsg1 & "Please enter an Address<br>"
End If
If ErrorMsg1 = "" Then
SQLString = "INSERT INTO tbl???("
For each Field in Request.Form
SQLString = SQLString & Field & ", "
Next
SQLString = Left(SQLString, (Len(SQLString) -2))
SQLString = SQLString + ") VALUES ("
For each Field in Request.Form
TheString="<input type=""HIDDEN"" name=""" & Field & """ value="""
StrValue = Request.Form(Field)
TheString=TheString + cstr(StrValue) & """>" & VbCrLf
Response.Write TheString
SQLString = SQLString + "'" & Request(Field) & "', "
Next
SQLString = Left(SQLString, (Len(SQLString) -2))
SQLString = SQLString + ");"
objCon.Execute(SQLString)
'if you need to perform any database validations
'this would be a good place.
'once you are all done redirect to a final page
Response.Redirect "main.asp?page=???"
End If
End If
I'm writing some basic server-side validation - must be vbscript
I'd like to incorporate within the code below a password checker for fields Pass1 and Pass2 i.e. they must be at least 6 characters, no spaces, at least one number and of course must match + anything else I've forgot !
I also could do with an email validator to fit in below
any help much appreciated
thanks
If Request.Form.Count > 0 Then
OrganisationName = Request.Form("Org_Name")
OrganisationType = Request.Form("Org_Type")
PostCode = Request.Form("PostCode")
Address = Request.Form("Address1_1")
Password = request.form("Pass1")
Password1 = request.form("Pass2")
If OrganisationName = "" Then
ErrorMsg1 = ErrorMsg11 & "Please enter your Organisation Name<br>"
End If
If OrganisationType = "" Then
ErrorMsg1 = ErrorMsg1 & "Please enter an Organisation type<br>"
End If
If PostCode = "" Then
ErrorMsg1 = ErrorMsg1 & "Please enter a PostCode<br>"
End If
If Address = "" Then
ErrorMsg1 = ErrorMsg1 & "Please enter an Address<br>"
End If
If ErrorMsg1 = "" Then
SQLString = "INSERT INTO tbl???("
For each Field in Request.Form
SQLString = SQLString & Field & ", "
Next
SQLString = Left(SQLString, (Len(SQLString) -2))
SQLString = SQLString + ") VALUES ("
For each Field in Request.Form
TheString="<input type=""HIDDEN"" name=""" & Field & """ value="""
StrValue = Request.Form(Field)
TheString=TheString + cstr(StrValue) & """>" & VbCrLf
Response.Write TheString
SQLString = SQLString + "'" & Request(Field) & "', "
Next
SQLString = Left(SQLString, (Len(SQLString) -2))
SQLString = SQLString + ");"
objCon.Execute(SQLString)
'if you need to perform any database validations
'this would be a good place.
'once you are all done redirect to a final page
Response.Redirect "main.asp?page=???"
End If
End If