Pass entire form as data in jQuery Ajax function

There’s a function that does exactly this:

http://api.jquery.com/serialize/

var data = $('form').serialize();
$.post('url', data);

Leave a Comment