Real Time Password Matching Checker

Share Now

Share on facebook
Share on pinterest
Share on twitter
Share on linkedin
Share on email

#Put This Into jQuery(document).ready function

function checkPasswordMatch() {
    var password = $(".txtNewPassword").val();
    var confirmPassword = $(".txtConfirmPassword").val();

    if ((password !== "" && confirmPassword !== "") && (password != confirmPassword)) {

        $("#input_box_1578523623_field").html("<div class='erro-mix'>Passwords do not match!</div>");
    }

    if ((password !== "" && confirmPassword !== "") && (password == confirmPassword)) {

        $("#input_box_1578523623_field").html("<div class='erro-mix-g'>Passwords match!</div>");

    }
}

$(".txtNewPassword, .txtConfirmPassword").keyup(checkPasswordMatch);
Nahid Mahamud

Nahid Mahamud

Web Developer | Graphic Designer | WordPress & Woo-commerce Expert