On form submit I want to serialize the form's elements, then stick another field on, then submit with $.post. Can't quite get it. The form's submit action looks like:
data = $(this).serializeArray();
data.push({filter: $.toJSON(filter)});
$.post("/datawarehouse/new.php", data);
return false;
But it's just the form's fields and then undefined/undefined. For the record $.toJSON(filter) works as I've seen the output. Also tried:
data.filter = $.toJSON(filter);
And
data['filter'] = $.toJSON(filter);
Any ideas?