Mritunjay 11 Questions 0 Answers 0 Best Answers 21 Points View Profile0 Mritunjay Asked: September 11, 2019In: JAVASCRIPTvalidation on confirm password in javascript ?0Please provide me the code with html part also.javascript ShareFacebookReport1 AnswerVotedOldestRecentManish Garg 142 Questions 8 Answers 5 Best Answers 167 Points View ProfileBest Answer Manish Garg Added an answer on September 12, 2019 at 5:57 pm Please Check the code for password and confirm password validation <form method="post" action=""> <div class="selling-registraion bg-white"> <div class="srtitle">Forgot Password</div> <div class="row mb-20"> <div class="col-lg-12"> <div class="md-input"> <input class="md-form-control" required="" type="password" id="user_password" name="user_password"> <span class="highlight"></span> <span class="bar"></span> <label>New Password</label> </div> <div class="md-input"> <input class="md-form-control" required="" type="password" id="user_conf_password" name="user_conf_password"> <span class="highlight"></span> <span class="bar"></span> <label>Confirm Password</label> </div> </div> </div> <div class="row text-center"> <div class="col-lg-12"> <button type="submit" onclick="return checkpass($(this))" class="btn btn-primary lr-button mb-20">Reset</button> </div> </div> </div> </form> <script> function checkpass(s) { var user_password =$('#user_password').val(); if(user_password=='') { $('#error_message').html('Please Enter New Password'); $('#error_message').show(); return false; } var user_conf_password =$('#user_conf_password').val(); if(user_conf_password=='') { $('#error_message').html('Please Confirm Password'); $('#error_message').show(); return false; } if(user_password!=user_conf_password) { $('#error_message').html('New Password and Confirm Password does not match'); $('#error_message').show(); return false; } } </script> 0Reply Share ShareShare on FacebookShare on TwitterShare on Google plusShare on WhatsAppLeave an answerLeave an answerCancel reply Featured image Select file Browse
Manish Garg
Please Check the code for password and confirm password validation