<!DOCTYPE html>
<html>
<head>
<script>
function pass_validation()
{
var firstpassword=document.f1.password1.value;
var secondpassword=document.f1.password2.value;
if(firstpassword==secondpassword){
return true;
}
else{
alert("Password does Not Match");
return false;
}
}
</script>
</head>
<body>
<form name="f1" action="/JavaScript/Index" onsubmit="return pass_validation()">
Password:<input type="password" name="password1" /><br/>
Re-enter :<input type="password" name="password2"/><br/>
<input type="submit">
</form>
</body>
</html>