I have an array (for checkboxes) that I need to pass alongside the regular form in an ajax post, but can’t seem to get this to work:
new_data = [a,b,c,d,e];
somedata_assoc = JQuery.param({'choices[]': new_data});
$.ajax({
type: "POST",
url: contract_qurl,
data: $(div).find("form").serialize()+"&"+somedata_assoc,
context: $(this),
success: function(data) { $("#results_table").html(data); }
});
I’m getting a javascript error on this line
I had to change it to this
you capitalized the J in jQuery in this line
should be this (or just the $ shorthand)
also, i dont think you need the brackets, in most cases they would make it more difficult to retrieve the data on the server