Flash notice on submit if passwords don't match

This commit is contained in:
Jan Bader 2016-12-20 14:34:29 +01:00
parent 9db0ea1870
commit 3406ce58cf

View File

@ -22,8 +22,16 @@
}
$(document).ready(function () {
$("#password, #password_confirm").keyup(checkPasswordMatch);
$("#password, #password_confirm").keyup(checkPasswordMatchUi);
$('#invalidCredentials').hide();
$('#loginForm').ajaxForm({
beforeSubmit: function(a, b, c) {
var match = checkPasswordMatch();
if(!match){
$("#divCheckPasswordMatch").fadeOut(300).fadeIn(300).fadeOut(300).fadeIn(300);
}
return match;
},
success: function() {
window.location.href = "/api/v1/restricted";
},
@ -55,6 +63,10 @@
<div id="divCheckPasswordMatch">
</div>
<div id="invalidCredentials">
Username already exists
</div>
<input type="submit" value="Login" />
</form>
</div>