form validation script ..........

wxdqz

New Member
my javascript for validating the form is not working ........
i dont know why ....
please help me in this regard .......
here is the code .........



<html>
<head>



<title>Login</title>
<SCRIPT LANGUAGE = "JavaScript">

function validate(){

var reg = document.f1.reg_no.value
var pss = document.f1.pass.value

if (reg==")
{
alert('You have to provide your Registeration number.Please try atain');
event.returnValue=false;
}

if(pass=="){
alert('You have to provide the password.Please try again!');
event.returnValue=false;
)
}
</SCRIPT>






</head>
<body bgcolor="#C0C0C0">
<br>
<h3 align="center">Login Page</h3>
<p align="center"><i>Enter your reg. no and password to proceed further</i></p>
<br><br><br>
<form name="f1" action="ado_st.asp" method=post onSubmit="validate();" >
<P align="center" >
Reg. Number:
<input type="text" name="reg_no" size=10><br><br>
Password :<input type="password" name="pass" size=8><br><br>

<input type="Checkbox" name="save" value=http://www.webdeveloper.com/forum/archive/index.php/"OFF">Remember me
<br><br>
<input type="Submit" value="Login">
</p>
</form>
</body>
</html>
 
Back
Top