validating input
I am trying to validate my input by writing a client side vbscript, but it is not working and I don't have errors, but it's not validating my input. Here's the code:
<% Response.Expires = 0 %>
<% Response.Buffer = False %>
<html>
<head>
Password verification are you caching
<Title>Passoword change website</title>
</head>
<body>
<h2>Try changing your password</h2>
are you caching
<form method=post action="start2201.asp" NAME=frmUser>
<p>Please enter your student id:</p>
<p><INPUT type="text" name="StudentId" size="10"></p>
<p>Please enter your student old password:</p>
<p><INPUT type="password" name="Password"></p>
<p>Please enter your newpassword:</p>
<p><INPUT type="password" name="NewPassword"></p>
<p>Please verify your new password:</p>
<p><INPUT type="password" name="VerifyPassword"></p>
<p><input type="submit" value="Submit"><input type="reset" value="Reset"></p>
</form>
<SCRIPT language="vbscript">
Sub VerifyData()
If Len(frmUser.NewPassword.value) = 0 then
Alert ("You must enter a password")
frmUser.Newpassword.focus
Exit Sub
end if
Call frmUser.submit()
End Sub
</SCRIPT>
</body>
</html>
|