Created
February 27, 2009 17:06
-
-
Save mislav/71574 to your computer and use it in GitHub Desktop.
serializing the form in Prototype with correct submit button
This file contains 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
var currentSubmit = null | |
form.select('input[type=submit]').invoke('observe', 'click', function(e) { | |
currentSubmit = this.name | |
}) | |
form.observe('submit', function(e) { | |
var params = this.serialize({ submit: currentSubmit }) | |
console.log(Object.inspect(params)) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment