I’m starting a web programming, because so far I used only to web design.
My problem is that I´ve done a survey that show a form with 12 questions per department. The number of departments depends on a previous selector called “sections”.
Thus, the form can show 12 questions fields if “section” has 1 department, or 120 if “section” has 10 departments.
I serialize and encode data to Base64 before submit:
// Setup call
$.ajax({
type: 'GET',
url: 'survey_actions.php&action=save',
data: { parameters: Base64.encode($("#mySurvey").serialize()) },
dataType: 'text',
beforeSend:function(){
// Load waiting panel
loader("on");
},
success:function(response){
[...]
I´m sure this is not the clean method and for that I am experiencing the following problem: when the number of fields to fill is low (for example 12), all works OK, but when the number is higher (for example 72), no all data is received by server.
The fields are named as follows: “sectorID_questionID”. So on post, params string is:
...&1_0=X&1_1=X&1_2=X&1_3=X...
(X is the value that the user has given to the question).
So the question: what is the most appropiated way to solve it and send huge data to the sever using AJAX without get it trimmed?
Sincerely, thanks for your help 🙂
Ajax can only take data in a query string. So, if large data is not being sent properly, it may be a limitation of your server/application.platform. You may very well look into increasing the max_input_vars. And also make sure you use POST and not GET