I need to perform a non-ajax post by clicking the submit of a form. Before submiting I have to add some additional form parameters. Here is how I do this:
$("#my_form").on("submit", function (e) {
e.preventDefault();
var data = $(this).serializeArray();
data.push({"name": "extra data1", "value": "extra value 1"});
var params = $.param(data);
//what's next?
//$.post($(this).attr("action"), data: params); // ajax request, I don't need an ajax request
});
But how do I actually submit the form so it will send not only its parametes, but the additional ones I've added to it as well? Obviously, $(this).submit();
won't do this.