Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

save submit-button for form submit via button tags

Signed-off-by: Joel Nimety <jnimety@continuity.net>
  • Loading branch information...
commit 8326887d459b10d6bf0484c31093d3341715773c 1 parent bc281a4
@jnimety jnimety authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/rails.js
View
5 src/rails.js
@@ -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');
Please sign in to comment.
Something went wrong with that request. Please try again.