I have a form that is sent via POST as JSON. But I have an object array called classes [] in JavaScript. The object contains disciple, ch and course. That is, the array that is dynamically generated is something like:
, "ch": "2"}]
I used serialize () to generate the JSON of the form, but how do I pass that array on the same JSON so that I can access the data in php just like access with the result of serialize () / p>
I tried to use stringify, but it does not have a reference like the other form fields.
$.ajax({
type: "POST",
data: $('#form').serialize()+JSON.stringify(aulas),
url: "includes/post.php",
success: function(msg){
//teste
}
});