what I'm trying to achieve is to get existing form hidden fields, add another field which will contain an array, and then POST it to the server, but in the old fashion way. I mean that after the POST, the page should get the new HTML from the server as a normal form post will do.
I tried using $.post()
, but this works like an AJAX request, the page is not reloaded from the server.
I thought I can dynamically add a hidden field, and right before submit populate its value with my array. But by doing so it might be truncated by the browser. The array sometimes can get very big, it's an array of fields with data from a CSV file. So i have no control over the length of the array. If user will process a 500 rows CSV, the array will probably have around 2000 key values.
So basically I'm looking for a solution like $.post() where i can populate the submit data by just passing my array, but with the real behaviour of a form. Page must be submitted and replaced entirely with server response. I found some "hacks" to replace the page with ajax response, but they are too hacky and don't work every browser.