javascript - How to change a jQuery Form POST into a JSON object and Post it instead? -
javascript - How to change a jQuery Form POST into a JSON object and Post it instead? -
i building module sugarcrm used many people. on ran probelm when saving info php losing part of post, learned problem caused php ini setting max_input_vars
once increased value set max_input_vars, worked perfect again.
i able set max_input_vars value .htaccess file. have ready cannot set value php function ini_set()
my major concern module used on many different servers used many people.
i need code solution require user nil , still have module go on function correctly.
on post user had recommended alter html form saved info using jquery ajax post backend php script.
he says should alter save info s ending json object php backend script instead of big number of post vars.
does else see solution?
here current frontend code handles save now....
function ajaxsavetasks(){ window.unsavedchanges = false; // display message user saving ajaxstatus.showstatus('saving task changes'); var url = "index.php?module=apoll_web_projects"; // script handle form post. //sugar.ajaxui.showloadingpanel(); jquery('#project_tasks').showloading(showloadingsettings); $.ajax({ type: "post", url: url, data: $("#edittasksform").serialize(), // serializes form's elements. success: function(data) { //alert(data); // show server response //sugar.ajaxui.hideloadingpanel(); hidetaskunsavedchangesheaderbar() jquery('#project_tasks').hideloading(); } }); ajaxstatus.hidestatus(); }; the other user mentions if code modified post form using json instead can around max_input_vars issue altogether. if understand correctly, saying instead of 1,000+ form post variables beingness sent, send 1 variable holds huge giant json string instead...does sound right?
if sounds solution, show me how might accomplish this?
my form page mass adding , editing project task database records, can big , have hundreds of task records update in database.
in code above can see runs $("#edittasksform").serialize() form fields.
javascript php jquery ajax json
Comments
Post a Comment