Skip to content

Instantly share code, notes, and snippets.

@jblac
Created January 1, 2013 21:50
Show Gist options
  • Save jblac/4430282 to your computer and use it in GitHub Desktop.
Save jblac/4430282 to your computer and use it in GitHub Desktop.
$.fn.resetForm = function() {
$(this).removeAlertBoxes();
return this.each(function() {
// guard against an input with the name of 'reset'
// note that IE reports the reset function as an 'object'
if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType))
this.reset();
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment