My overall goal is to get all some of all drop-downs on a page and send that to be processed by a php file.
Right now, the way I'm doing it in jQuery is making an overall schedule array and then adding each element to be updated to that array. So I have something like:
var schedule = [];
var data = {
'user_id' : '12',
'day_of_week' : 'Monday',
'when' : 'start',
'time' : '12 AM'
}
schedule.push(data);
var data = {
'user_id' : '13',
'day_of_week' : 'Tuesday',
'when' : 'end',
'time' : '12 AM'
}
schedule.push(data);
// schedule would have two objects in it
Obviously in loops and and stuff.
So, my schedule array has two objects in it, in this case.
Now, is it possible to use that schedule array as the ajax data? It doesn't work if I do something like:
$.ajax({
url: 'http://something.com/ajax',
data: schedule,
type: 'POST'
});
But if I instead change it to schedule[0]
it works just fine, but only for the first thing in the schedule array, obviously.