hi,
want to validate the form input before i submit the page and show an alert box to the user. the fillowing is the code can any one suggest a way to do it
======== CODE ========
<%
Dim ConLog 'For Opening Connection to Db
Dim rs 'For RecordsSet
'==== Before this i would like to validate and show the
'==== alert box, on error the following code should not execute
Set ConLog = Server.CreateObject("adodb.connection"
ConLog.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ=c:\inetpub\Set rs = ConLog.Execute("select * from usr where username='" & _
session("me"
& "' and password='" & Request.Form("txtOldPwd"
& "'"
if rs.eof = false then
ConLog.Execute("Update usr set password='" & Request.Form("txtReNew"
& "' where username='" & Session("me"
& "'"
Response.Write "Successfully Changed"
end if
%>
<html>
<head>
<title>Change Password</title>
</head>
<body>
<form method = post id=form1 name=form1>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="50%">Old Password</td>
<td width="50%"><input type="text" name="txtOldPwd" size="20"></td>
</tr>
</table>
</form>
</body>
</html>
![[cheers] [cheers] [cheers]](/data/assets/smilies/cheers.gif)
Niraj![[noevil] [noevil] [noevil]](/data/assets/smilies/noevil.gif)
want to validate the form input before i submit the page and show an alert box to the user. the fillowing is the code can any one suggest a way to do it
======== CODE ========
<%
Dim ConLog 'For Opening Connection to Db
Dim rs 'For RecordsSet
'==== Before this i would like to validate and show the
'==== alert box, on error the following code should not execute
Set ConLog = Server.CreateObject("adodb.connection"
ConLog.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ=c:\inetpub\Set rs = ConLog.Execute("select * from usr where username='" & _
session("me"
if rs.eof = false then
ConLog.Execute("Update usr set password='" & Request.Form("txtReNew"
Response.Write "Successfully Changed"
end if
%>
<html>
<head>
<title>Change Password</title>
</head>
<body>
<form method = post id=form1 name=form1>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="50%">Old Password</td>
<td width="50%"><input type="text" name="txtOldPwd" size="20"></td>
</tr>
</table>
</form>
</body>
</html>
![[cheers] [cheers] [cheers]](/data/assets/smilies/cheers.gif)
Niraj
![[noevil] [noevil] [noevil]](/data/assets/smilies/noevil.gif)