1Remove the required: true rule.
2
3Demo: Fiddle
4
5jQuery('.validatedForm').validate({
6 rules : {
7 password : {
8 minlength : 5
9 },
10 password_confirm : {
11 minlength : 5,
12 equalTo : "#password"
13 }
14 }
1let pattern = new RegExp("^(?=(.*[a-zA-Z]){1,})(?=(.*[0-9]){2,}).{8,}$"); //Regex: At least 8 characters with at least 2 numericals
2 let inputToListen = document.getElementById('pass-one'); // Get Input where psw is write
3 let valide = document.getElementsByClassName('indicator')[0]; //little indicator of validity of psw
4
5 inputToListen.addEventListener('input', function () { // Add event listener on input
6 if(pattern.test(inputToListen.value)){
7 valide.innerHTML = 'ok';
8 }else{
9 valide.innerHTML = 'not ok'
10 }
11 });
1var check = function() {
2 if (document.getElementById('password').value ==
3 document.getElementById('confirm_password').value) {
4 document.getElementById('message').style.color = 'green';
5 document.getElementById('message').innerHTML = 'matching';
6 } else {
7 document.getElementById('message').style.color = 'red';
8 document.getElementById('message').innerHTML = 'not matching';
9 }
10}