found this code to validate the email address?
<html>
<head>
<title>VBscript email validation</title>
</head>
<body>
<%
Dim emailAddress
emailAddress = Request("emailAddress")
if emailAddress <> "" then
emailAddress = Cstr(emailAddress)
if emailAddress <> "" then
blnValidEmail = RegExpTest(emailAddress)
if blnValidEmail then
Response.Write("Valid email address")
else
Response.Write("Not a valid email address")
end if
end if
Function RegExpTest(sEmail)
RegExpTest = false
Dim regEx, retVal
Set regEx = New RegExp
' Create regular expression:
regEx.Pattern ="^[\w-\.]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]{2,3}$"
' Set pattern:
regEx.IgnoreCase = true
' Set case sensitivity.
retVal = regEx.Test(sEmail)
' Execute the search test.
If not retVal Then
exit function
End If
RegExpTest = true
End Function
Else
%>
<form action="emailCheck.asp" method="post">
<input type="text" name="emailAddress">
<input type="submit" value="submit">
</form>
<%End If %>
</body>
</html>
this is the good vbs i have on my page:
<%
IF request.form ("Message")="True" THEN
strTB1=request.form("UserName")
strTB2=request.form("StoreName")
strTB3=request.form("EMail")
'Opening the DataBase Object
set objConn = server.createobject("ADODB.Connection")
objConn.Open "DSN=info"
set cm = Server.CreateObject("ADODB.Command")
cm.ActiveConnection = objConn
cm.CommandText ="INSERT INTO SampleDb(TB1,TB2,TB3) VALUES (?,?,?)"
'First Text Box Parameter Statement
set objparam=cm.createparameter(, 200, , 255, strTB1)
cm.parameters.append objparam
'Second Text Box Parameter Statement
set objparam=cm.createparameter(, 200, , 255, strTB2)
cm.parameters.append objparam
'Third Text Box Value Parameter Statement
set objparam=cm.createparameter(, 200, , 255, strTB3)
cm.parameters.append objparam
cm.execute
response.write("Thank you!")
ELSE%>
here is the the input html code for the form:
<form name="zoo.asp" action="zoo.asp" method="POST">
<center>
<table border="0" width="70%" cellspacing="0" cellpadding="0"
bgcolor="#0000FF">
<tr>
<td width="50%"> <table border="0" width="352" cellspacing="0"
cellpadding="5" bgcolor="#0000FF">
<tr>
<td width="128">
<p><b><font color="#FFFFFF">User Name:</font></b>
</td>
<td width="220">
<p><input name="UserName" size="24"> </p>
</td>
</tr>
<tr>
<td width="128"><b><font color="#FFFFFF">Store Name:</font></b></td>
<td width="50%">
<select size="1" name="StoreName">
<option selected>Please Choose A Store</option>
<option>Beavercreek North</option>
<option>Beavercreek South</option>
<option>Brown Street</option>
<option>Centerville</option>
<option>Fairborn</option>
<option>Huber Heights</option>
<option>Smithville</option>
<option>Springboro</option>
<option>Vandalia</option>
<option>Wilmington Pike</option>
<option>Wilmington South</option>
<option>Wright State</option>
<option>Beavercreek North</option>
<option>Xenia</option>
</select>
</td>
</tr>
<tr>
<td width="128"><p><b><font color="#FFFFFF">E-Mail
Address:</font></b></td>
<td width="220" bgcolor="#0000FF"><p><input name="EMail" size="24">
</td>
</tr>
</table>
<input type="HIDDEN" name="Message" value="True"><input type="submit"
value="Submit">
</form>
my question is where do i put the validation code? more specifically
where exactly, i am having trouble marrying the input code with the
validation code.
these are the things i know
1)emailcheck.asp i will not need
2)i think that i will replace the variable emailAddress with Email
thanks
craig