I'm having trouble sending the form via ajax. In addition to the fields populated by the user, I need to send an array
of objects together.
AJAX POST:
submitHandler: function (form) {
$.ajax({
url: urlPost,
type: "POST",
dataType: "json",
data: $(form).serialize() + JSON.stringify(myArray),
success: function (resposta) {
alert('success');
}
});
}
If I send only $(form).serialize()
I can, but with the array
not.
ARRAY:
myArray = [{name: 'a', node: 1}, {name: 'b', node: 12}, ...];