I have a form on a web page that I need to implement some sort of validation. After some research, I decided that javascript is out of the question for this. (users can turn off, bypass if really wanted to among others)
There are only two fields....a name "Name" and email address "EMail"
They currently submit to a DB via odbc dsn connection. using POST , the form is set to submit to the following .asp page:
SO, WHat I want to do, is have the info validated, hopefully via vbscript or similar. if no errors, the data would go to the processing page as normal....BUT if there are errors in either fields, a line would appear near the field with the problem (on the same page as the form.)
I have done a lot of research and can not find anything concrete, and would appreciate any input. Thanks in advance.
Gary
There are only two fields....a name "Name" and email address "EMail"
They currently submit to a DB via odbc dsn connection. using POST , the form is set to submit to the following .asp page:
Code:
<!-- #INCLUDE FILE = "DataStore.inc" -->
<!-- #INCLUDE FILE = "adovbs.inc" -->
<%
'the purpose of this page is to add users to the database
%>
<%
'create variable to hold email address
DIM EMail
Email = Request.Form("EMail")
Dim Name
Name = Request.Form("Name")
'create variable to hold database object and initialize it
Dim objRec
Set objRec = Server.CreateObject("ADODB.Recordset")
'open the database table asptest
objRec.Open "test", strConnect, adOpenStatic, _
adLockOptimistic, adCmdTable
'create a new record
objRec.AddNew
'set the field equal to the variable
objRec("EMail") = EMail
objRec("Name") = Name
'update the database with the new record
objRec.Update
'close the database
objRec.Close
Set objRec = Nothing
'un-comment this line to point to your desired confirm page
Response.Redirect("[URL unfurl="true"]http://www.robarspages.ca/devroot/computersite/aspvalid.asp")[/URL]
%>
SO, WHat I want to do, is have the info validated, hopefully via vbscript or similar. if no errors, the data would go to the processing page as normal....BUT if there are errors in either fields, a line would appear near the field with the problem (on the same page as the form.)
I have done a lot of research and can not find anything concrete, and would appreciate any input. Thanks in advance.
Gary