How to transfer the form data to another page using jquery?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
23 views
Is it checkboxes, dates, and TP data. Using jquery to get the data:
var new_params = $( '#simpleFilter' ).serializeArray();

now you need to transfer the data as query string to another page.
In php I use http_build_query, attach the way of doing the redirect and all. Most likely something similar is easily done in jquery/javascript. Need guidance.

As you like without serializeArray. To get the data form one row and to form from it a string suitable to be sent as get-parameter to another script
by | 23 views

2 Answers

0 like 0 dislike
Solution found:
var new_params = $( '#simpleFilter' ).serializeArray(); var http_build = "; for(var i = 0; i < new_params.length; i++) { //c[new_params[i]['name']] = new_params[i]['value']; if ( new_params[i]['name'] !== '_csrf' ) http_build += "" + new_params[i]['name'] + "=" + new_params[i]['value'] + "&"; } var new_path = window.document.location.origin + '/controller/action?' + http_build; window.location.href = new_path;

obtaining all the parameters of the shape, ignoring the extra element (_csrf), the formation of line parameters and transfer to a new page with the received parameters.
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
0 like 0 dislike
3 answers
0 like 0 dislike
2 answers
110,608 questions
257,187 answers
0 comments
40,796 users