i am relatively new to javascript
i am trying for a password validation code
but iam not able to stop the page from loading the page when the
password is wrong. the code is as below
------------------
<html>
<head>
<title>New User</title>
<script language = "JavaScript">
function validatePasswords() {
if (document.passForm.password1.value !=
document.passForm.password2.value) {
alert("Passwords don't match, try again");
document.passForm.password1.focus();
document.passForm.password1.select();
return false;
} else
return true;
}
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="passForm" method="post" onsubmit="validatePasswords()"
action="http://www.google.com">
<h1>New user password form</h1>
<p> Username: <input type="text" name="username"><br>
Password: <input type="password" name="password1"><br>
Check password: <input type="password" name="password2"><br>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
</body>
</html>
-------------------
can u please tell me where am i going wrong
thank you
waiting eagerly for some suggestions
Brijesh