Skip to content

Instantly share code, notes, and snippets.

@mislav
Created February 27, 2009 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mislav/71574 to your computer and use it in GitHub Desktop.
Save mislav/71574 to your computer and use it in GitHub Desktop.
serializing the form in Prototype with correct submit button
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