The following worked for me. You can use serializeArray () serializeJSON () as shown below and set this for the data item. Note the variable formData strong>.
var formData = $('#inputForm').serializeJSON(); $.ajax({ type : "POST", url: server_side_url, cache:false, traditional: true, data: formData, dataType: "json", success: function(data, textStatus, jqXHR){ console.log("successfully processed."); }, error: function(xhr,status,error){ console.log("error occurred."); } });
source share