Simple Javascript Code to match password and confirm password
CODE :
<script>
function check()
{
if(document.f1.pwd.value != document.f1.cpwd.value)
{
document.getElementById("res").innerHTML="<font color='red'>pwd and cpwd does not match</font>";
}
else
{
document.getElementById("res").innerHTML="<font color='green'>pwd and cpwd are matched</font>";
}
}
</script>
<h2>Password And Confirm Password Match Tutorial</h2>
<form action="" method="post" name="f1">
<p>User Password : <input type="password" name="pwd" placeholder='enter password'></p>
<p>Re-enter Password : <input type="password" name="cpwd" placeholder="re-enter password" onkeyup="check()"> <span id="res"></span></p>
</form>
For maore tutorials vasit on blog phpedu108.blogspot.in
No comments:
Post a Comment