Skip to content

Instantly share code, notes, and snippets.

@Patrick64
Created June 27, 2011 15:47
Show Gist options
  • Save Patrick64/1049120 to your computer and use it in GitHub Desktop.
Save Patrick64/1049120 to your computer and use it in GitHub Desktop.
JQuery: Include this javascript in your page so when the user submits a form their browser opens a new window with the form contents in the querystring.
//open a new window with form fields put in querystring, rather than submit form
$('document').ready(function() {
$('form').submit(function() {
var url = $(this).attr('action') + '?' + $(this).serialize();
window.open(url);
return false; // dont submit form
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment