Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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');
  }
}
Comment

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>
Comment

PREVIOUS NEXT
Code Example
Javascript :: mongodb findOneAndUpdate return updated 
Javascript :: replace line break with html line break js 
Javascript :: how to make hide/show btn in js 
Javascript :: check if an object contains a value in javascript 
Javascript :: react native header height 
Javascript :: datatable get all selected row data 
Javascript :: union of two objects javascript 
Javascript :: nestjs version 
Javascript :: website edit js 
Javascript :: js display 2d array 
Javascript :: multiline comment in react 
Javascript :: react router 
Javascript :: javascript check less width of window 
Javascript :: Nuxt: Nuxt auth not redirecting after logout 
Javascript :: add bootstrap to angular 13 
Javascript :: react parameter value from query string 
Javascript :: To split a full name into first and last names in JavaScript 
Javascript :: empty input of clone jquery 
Javascript :: react fetch url 
Javascript :: node js cron example 
Javascript :: btn.addeventlistener 
Javascript :: alpine in laravel mix 
Javascript :: chartjs hide text inside bar 
Javascript :: how to make a textarea unwritable in react native 
Javascript :: nuxt looks for npm_modules on express 
Javascript :: TypeError: client.guilds.forEach is not a function 
Javascript :: jquery get radio checked value 
Javascript :: how to set cookies in node js 
Javascript :: get url without parameters javascript 
Javascript :: js remove null from array 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =