Sunday, 25 August 2013

posting multiple objects in an ajax call

posting multiple objects in an ajax call

I have a list of data which is within multiple objects
each object has an ID and a status and then the main object has a type and
a form id
the problem i am having is posting result via ajax as it doesnt like the
multiple objects.
this is the code i have
var permissionsData = [];
$(".workflowBox").each(function(index, element) {
var obj = {
status: $(this).attr("data-user-status"),
record:$(this).attr("data-user-id")
};
permissionsData.push(obj);
});
permissionsData.userGroupID = userGroupID;
permissionsData.formID = formID;
var posting = $.ajax({
url: "http://www.test.com",
method: 'post',
data: permissionsData
});
How can I wrap/send permission data?
Thanks

No comments:

Post a Comment