Skip to content

Instantly share code, notes, and snippets.

@ireneyiu
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ireneyiu/b41ab8e07249b255c2b3 to your computer and use it in GitHub Desktop.
Save ireneyiu/b41ab8e07249b255c2b3 to your computer and use it in GitHub Desktop.
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