Friday, January 25, 2013

Validation of Username and Password


<!--Validation of Username and Password........fensasaj@blogspot.com-->
<html>
<head>
</head>
<body bgcolor="cyan">

<form>

<h3 align="center">username<input type="text" name="userid"/>
</h3>
<br>
<h3 align="center">password<input type="password" name="password"/>
</h3>
<br>
<input type ="button" onclick="check(this.form)" value="submit"/>

<input type="reset" value="reset"/>

</form>

<script language="javascript">

function check(form)
{
 if(form.userid.value=="lbs"&&form.password.value=="it")
 {
  document.write("Welcome lbs!!");
 }
 else
 {
  alert("you are a wrong user");
 }
}

</script>

</body>

</html>

No comments:

Post a Comment