<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script language="javascript">
function validation()
{
if(document.form1.user.value=="")/*For blank*/
{
alert("Plz Enter A User Name");
document.form1.user.focus();
return false();
}
var iChars = "!@#$%^&*()+=-[]/';,./{}|\":<>?"; /*For sapcile charter*/
for (var i = 0; i < document.form1.user.value.length; i++)
{
if (iChars.indexOf(document.form1.user.value.charAt(i)) != -1)
{
alert ("Your username has special characters. \nThese are not allowed.\n Please remove them and try again.");
return false;
}
}
if(isNaN(document.form1.pass.value))
{
alert("Plz Enter Numbers Only");
document.form1.pass.focus();
return false;
}
if(document.form1.user.value=="jaggikhanna" && document.form1.pass.value=="123456") FOR USERNAME & PASSWORD COMPARE
{
window.open("FILE YOU WANT TO OPEN")
}
else
{
alert("Invalid Username Or Password");
document.form1.user.focus();
document.form1.user.onreset();
return false;
}
}
</script>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<table width="400" border="0" cellspacing="5" cellpadding="5" align="center">
<tr>
<th colspan="2">Login</th>
</tr>
<tr>
<td>User Name</td>
<td><input type="text" name="user" id="user" /></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="pass" id="pass" /></td>
</tr>
<tr>
<td><input type="submit" name="button" id="button" value="Submit" onclick="return validation()" /></td>
<td><input type="reset" name="button2" id="button2" value="Reset" /></td>
</tr>
</table>
</form>
</body>
</html>
whats this jaggi G
ReplyDeleteread it carefully
ReplyDelete