<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function validation(){
var fpassword=document.f1.password.value;
var spassword=document.f1.password2.value;
if(fpassword==spassword){
return true;
}
else{
alert("password must be same!");
return false;
}
}
</script>
</head>
<body>
<form name="f1" action="C:\Users\tejas\OneDrive\Desktop\newprogram\password_validation.html" onsubmit="return validation()">
Password:<input type="password" name="password" /><br/>
Re-enter Password:<input type="password" name="password2"/><br/>
<input type="submit">
</form>
</body>
</html>
output
0 Comments