I have a project in which I have to add a registration form and I want to to validate that the password and confirm fields are equal without clicking the register button.
You can check confirm password by only simple javascript
html
and in javascript
function register() {
var password= document.getElementById('password').value ;
var confirm= document.getElementById('confirmpassword').value;
if (confirm!=password){
var field = document.getElementById("checkconfirm")
field.innerHTML = "not match";
}
}
Also you can use onkeyup instead of onkeypress.