Reputation: 4660
I am using .post to post my data to my controller. I would like to pass all the data that I have in a form. Is there an easy way to take all the form data and add it to the .post command to send it?
Upvotes: 4
Views: 824
Reputation: 78104
$("form").submit(function(e) {
e.preventDefault();
$.post("/url", $(this).serialize(), callbackFunction);
});
Upvotes: 3