Created
March 29, 2013 03:58
-
-
Save jsam/5268677 to your computer and use it in GitHub Desktop.
Match passwords
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JS | |
function validatePass(p1, p2) | |
{ | |
if (p1.value != p2.value || p1.value == '' || p2.value == '') | |
{ | |
p2.setCustomValidity('Password incorrect'); | |
} else { | |
p2.setCustomValidity(''); | |
} | |
} | |
HTML | |
input(type="password", name="new_password", id="p1", ng-model="user.new_password", required) | |
label Repeat Password | |
input(type="password", name="new_password_repeat", onfocus="validatePass(document.getElementById('p1'), this)", oninput="validatePass(document.getElementById('p1'), this)", required) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment