Created
February 2, 2009 14:26
-
-
Save joshuaclayton/56924 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// With Rails remote form helpers, the AJAX call is bound on the onsubmit attribute. | |
// Submitting that form via a framework (Prototype, jQuery, etc.) doesn't use the onsubmit | |
// attribute's Javascript because it was never explicitly bound. Is this really the only | |
// way to have a framework trigger the code nestled within the onsubmit attr? | |
$(document).ready(function() { | |
$("form").each(function() { | |
var self = $(this); | |
self.submit(function() { | |
new Function(self.attr("onsubmit"))(); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment