assets/js/custom (another copy).js
/*New Password and confirm password match validation ------START-----*/
New Password and confirm password match validation START
New Password and confirm password match validation START
function validatechngpwdform()
    {
        var np_len = $(".np_password").val().length;
        var cnp_len = $(".cnp_password").val().length;
        var np_val = $(".np_password").val();
        var cnp_val = $(".cnp_password").val();
        var special_chars = "<>@!#$%^&*()_+[]{}?:;|'\"\\,./~`-=";
        if(np_len > 12 || cnp_len > 12 || np_len < 6 || cnp_len < 6)
        {
            $(".alert").removeClass('d-none');
            $(".np_password").css('border-color','red');
            $("#pwd_error").html('Password length must be in between 6 to 12 characters');
            return false;
        }else if(np_val != cnp_val)
        {
            $(".alert").removeClass('d-none');
            $(".np_password").css('border-color','red');
            $("#pwd_error").html('New password and confirm new password does not match');
            return false;
        }else if(np_val.match(/[A-Z]/) && np_val.match(/\d/) && np_val.match(/[A-z]/) && np_val.match(/[~!,@#%&_\$\^\*\?\-]/))
        {
            $(".alert").removeClass('d-none'); 
            $(".alert").addClass('success'); 
            $(".np_password").css('border-color','green');
            $("#pwd_error").html('Please wait while we are processing your request...');
            setTimeout(function(){ 
               $("#final_submit").attr("disabled",true);
             }, 1000);
            return true;
        }else
        {   $(".alert").removeClass('d-none');
            $(".np_password").css('border-color','red');
            $("#pwd_error").html('Password must include alphanumeric, special characters and capital letters');
            return false;
        }
 }
function validatechngpwdform ( ) { var np_len = $ ( ".np_password" ) . val ( ) . length ; var cnp_len = $ ( ".cnp_password" ) . val ( ) . length ; var np_val = $ ( ".np_password" ) . val ( ) ; var cnp_val = $ ( ".cnp_password" ) . val ( ) ; var special_chars = "<>@!#$%^&*()_+[]{}?:;|'\"\\,./~`-=" ; if ( np_len > 12 || cnp_len > 12 || np_len < 6 || cnp_len < 6 ) { $ ( ".alert" ) . removeClass ( 'd-none' ) ; $ ( ".np_password" ) . css ( 'border-color' , 'red' ) ; $ ( "#pwd_error" ) . html ( 'Password length must be in between 6 to 12 characters' ) ; return false ; } else if ( np_val != cnp_val ) { $ ( ".alert" ) . removeClass ( 'd-none' ) ; $ ( ".np_password" ) . css ( 'border-color' , 'red' ) ; $ ( "#pwd_error" ) . html ( 'New password and confirm new password does not match' ) ; return false ; } else if ( np_val . match ( / [A-Z] / ) && np_val . match ( / \d / ) && np_val . match ( / [A-z] / ) && np_val . match ( / [~!,@#%&_\$\^\*\?\-] / ) ) { $ ( ".alert" ) . removeClass ( 'd-none' ) ; $ ( ".alert" ) . addClass ( 'success' ) ; $ ( ".np_password" ) . css ( 'border-color' , 'green' ) ; $ ( "#pwd_error" ) . html ( 'Please wait while we are processing your request...' ) ; setTimeout ( function ( ) { $ ( "#final_submit" ) . attr ( "disabled" , true ) ; } , 1000 ) ; return true ; } else { $ ( ".alert" ) . removeClass ( 'd-none' ) ; $ ( ".np_password" ) . css ( 'border-color' , 'red' ) ; $ ( "#pwd_error" ) . html ( 'Password must include alphanumeric, special characters and capital letters' ) ; return false ; } }
New Password and confirm password match validation ------START
New Password and confirm password match validation ------ START