Answers for "match password and confirm password in javascript if true then submit form"

0

match password and confirm password in javascript if true then submit form

function onChange() {
  const password = document.querySelector('input[name=password]');
  const confirm = document.querySelector('input[name=confirm]');
  if (confirm.value === password.value) {
    confirm.setCustomValidity('');
  } else {
    confirm.setCustomValidity('Passwords do not match');
  }
}
Posted by: Guest on June-22-2021
1

password and confirm password validation js

var check = function() {
  if (document.getElementById('password').value ==
    document.getElementById('confirm_password').value) {
    document.getElementById('message').style.color = 'green';
    document.getElementById('message').innerHTML = 'matching';
  } else {
    document.getElementById('message').style.color = 'red';
    document.getElementById('message').innerHTML = 'not matching';
  }
}
Posted by: Guest on August-26-2020
0

match password and confirm password in javascript if true then submit form

<form>
  <label>Password: <input name="password" type="password" onChange="onChange()" /> </label><br />
  <label>Confirm : <input name="confirm"  type="password" onChange="onChange()" /> </label><br />
  <input type="submit" />
</form>
Posted by: Guest on June-22-2021

Code answers related to "match password and confirm password in javascript if true then submit form"

Code answers related to "Javascript"

Browse Popular Code Answers by Language