Skip to content

Instantly share code, notes, and snippets.

@bkeepers
Created July 19, 2010 02:32
Show Gist options
  • Save bkeepers/480948 to your computer and use it in GitHub Desktop.
Save bkeepers/480948 to your computer and use it in GitHub Desktop.
// hack to get which button was clicked
$('input[type=submit], button').live('click', function() {
$('<input type="hidden" class="button" />')
.attr({name:this.name, value:this.value || this.innerHTML})
.appendTo(this.form);
});
$('form').live('reset', function() {
$(this).find('input[type=hidden].button').remove();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment