Skip to content

Instantly share code, notes, and snippets.

@CodeOfficer
Created June 26, 2009 20:16
Show Gist options
  • Save CodeOfficer/136708 to your computer and use it in GitHub Desktop.
Save CodeOfficer/136708 to your computer and use it in GitHub Desktop.
$('button[type="submit"]').bind('click', function() {
this.setAttribute('originalValue', this.innerHTML);
this.disabled=true;
this.innerHTML='Submitting...';
result = (this.form.onsubmit ? (this.form.onsubmit() ? this.form.submit() : false) : this.form.submit());
if (result == false) { this.innerHTML = this.getAttribute('originalValue'); this.disabled = false };
return result;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment