Real time password matching using jQuery
In this post we will show you Real time password matching using jQuery, hear for Real time password matching using jQuery we will give you demo and example for implement.
This is a small snippet I used in my project for real time password matching. Please note that the below code only check whether password of password input field and confirm password input field match when we start typing in confirm password field and doesn't prevent from the form submission.
The javascript code is given below,
<script>
$(document).ready(function(){
$("#ConfirmPassword").keyup(function(){
if ($("#Password").val() != $("#ConfirmPassword").val()) {
$("#msg").html("Password do not match").css("color","red");
}else{
$("#msg").html("Password matched").css("color","green");
}
});
});
</script>
The HTML code is given below,
<div class="col-sm-4">
<div class="form-group"><label>Password</label>
<input type="password" id="Password" class="form-control input-sm" required/>
</div>
</div>
<div class="col-sm-4">
<div class="form-group"><label>Confirm Password</label>
<input type="password" id="ConfirmPassword" class="form-control input-sm" required/>
</div>
<div id="msg"></div>
</div>
Hope this code and post will helped you for implement Real time password matching using jQuery. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve onlincode. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs us
Comments
Post a Comment