|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
help with VB Script validation
I am having a problem with validation, I have a new members registration form which works at calling up the second form and adding the details to my Microsoft Access database, the problem I have is that I want to validate it using VB Scriptfor missing name address number etc but I can't seem to get this to work. The code from the two forms are below. Any help would be very much appreciated. Thank you
This is the new member registration form: <form name="form" method="post" action="addnewmember2.asp"> <table width="80%" border="0"> <tr> <td width="63%"><div align="right"><font face="Arial, Helvetica, sans-serif">First Name:</font></div></td> <td width="37%"><input name="txtName" type="text" size="15" maxlength="30"></td> </tr> <tr> <td height="28"><div align="right"><font face="Arial, Helvetica, sans-serif">Last Name:</font></div></td> <td><input name="txtName2" type="text" size="15" maxlength="20"></td> </tr> <tr> <td><div align="right"><font face="Arial, Helvetica, sans-serif">Address1:</font></div></td> <td><input name="txtAddress1" type="text" size="24"></td> </tr> <tr> <td><div align="right"><font face="Arial, Helvetica, sans-serif">Address2:</font></div></td> <td><input type="text" name="txtAddress2"></td> </tr> <tr> <td height="27"><div align="right"><font face="Arial, Helvetica, sans-serif">Date of Birth:</font></div></td> <td><input name="txtDOB" type="number" size="10" maxlength="12"></td> </tr> <tr> <td><div align="right"><font face="Arial, Helvetica, sans-serif">Telephone No:</font></div></td> <td><input name="txtTelephone" type="number" size="15"></td> </tr> <tr> <td><div align="right"><font face="Arial, Helvetica, sans-serif">Mobile No:</font></div></td> <td><input name="txtMobile" type="number" size="15"></td> </tr> <tr> <td><div align="right"><font face="Arial, Helvetica, sans-serif">Email :</font></div></td> <td><input type="text" name="txtEmail"></td> </tr> <tr> <td><div align="right"><font face="Arial, Helvetica, sans-serif">UserName:</font></div></td> <td><input name="txtUserName" type="text" size="15"></td> </tr> <tr> <td><div align="right"><font face="Arial, Helvetica, sans-serif">Password:</font></div></td> <td><input name="txtPassword" type="text" size="15"></td> </tr> <tr> <td><div align="right"> <input type="submit" name="Submit" value="Submit"><input type="reset" name="reset" value="Reset"></div></td> </tr> </table> </form> This is the second form <% dim conn, rs, sql, intTelephone, intMobile set rs = Server.CreateObject ("ADODB.Recordset") Set conn = Server.CreateObject("ADODB.Connection") conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Z:\videostore\videostore.mdb;Persist Security Info=False" sql = "SELECT * FROM [tblMember]" rs.open sql, conn, 3, 3 strFName= Trim(Request.Form("txtName")) strLName=Trim(Request.Form("txtName2")) strAddress1=Trim(Request.Form("txtAddress1")) strAddress2=Trim(Request.Form("txtAddress2")) strDOB=Trim(Request.Form("txtDOB")) intTelephone=Trim(Request.Form("txtTelephone")) intMobile=Trim(Request.Form("txtMobile")) strEmail=Trim(Request.Form("txtEmail")) strUserName=Trim(Request.Form("txtUserName")) strPassword=Trim(Request.Form("txtPassword")) rs.AddNew rs("FName")=strFName rs("LName")=strLName rs("Address1")=strAddress1 rs("Address2")=strAddress2 rs("DOB")=strDOB rs("Phone")=intTelephone rs("Mobile")=intMobile rs("Email")=strEmail rs("UserName")=strUserName rs("Password")=strPassword rs.Update rs.close Response.Redirect "login.asp" %> |
|
#2
|
||||
|
||||
|
Erm - you haven't attempted any validation?! What is the problem exactly?
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > help with VB Script validation |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|