-
-
Save ireneyiu/b41ab8e07249b255c2b3 to your computer and use it in GitHub Desktop.
This file contains 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
wfApp.settings.password.submit = function(e) { | |
e.preventDefault(); | |
var params = this.$el.serializeArray(); | |
var validationResult = this.validate(); | |
if (!validationResult.valid) { | |
$("#password-form input[name=new], | |
#password-form input[name=verify]").val("").first().focus(); | |
this.showMessage(this.form, validationResult.errors, "failure", 3000); | |
} else { | |
$("#password-form input").attr("disabled", true); | |
this.showMessage(this.form, "Saving..."); | |
$.post(this.submitUrl, params) | |
.then(this.processResponse.bind(this))) | |
.done(this.submitSuccess.bind(this)) | |
.fail(this.submitFail.bind(this)); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment