Flash notice on submit if passwords don't match
This commit is contained in:
parent
9db0ea1870
commit
3406ce58cf
@ -22,8 +22,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$("#password, #password_confirm").keyup(checkPasswordMatch);
|
$("#password, #password_confirm").keyup(checkPasswordMatchUi);
|
||||||
|
$('#invalidCredentials').hide();
|
||||||
$('#loginForm').ajaxForm({
|
$('#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() {
|
success: function() {
|
||||||
window.location.href = "/api/v1/restricted";
|
window.location.href = "/api/v1/restricted";
|
||||||
},
|
},
|
||||||
@ -55,6 +63,10 @@
|
|||||||
<div id="divCheckPasswordMatch">
|
<div id="divCheckPasswordMatch">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="invalidCredentials">
|
||||||
|
Username already exists
|
||||||
|
</div>
|
||||||
|
|
||||||
<input type="submit" value="Login" />
|
<input type="submit" value="Login" />
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user