Permalink
Browse files

save submit-button for form submit via button tags

Signed-off-by: Joel Nimety <jnimety@continuity.net>
  • Loading branch information...
1 parent bc281a4 commit 8326887d459b10d6bf0484c31093d3341715773c @jnimety jnimety committed Sep 28, 2010
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/rails.js
View
@@ -150,6 +150,11 @@
event.findElement('form').store('rails:submit-button', button.name || false);
});
+ document.on("click", "form button[type=submit]", function(event, button) {
+ // register the pressed submit button
+ event.findElement('form').store('rails:submit-button', button.name || false);
+ });
+
document.on("submit", function(event) {
var form = event.findElement(),
message = form.readAttribute('data-confirm');

0 comments on commit 8326887

Please sign in to comment.