Reputation: 12224
I can not figure out the syntax for this.
Here's my code:
$('select[id^="lookup_"]').change(function() {
var d = $("#lookupform").serializeArray();
// This is the problem line
d.push("field=" + $(this).id);
hash = { type: "POST", url: "/map/details", data: d };
$.ajax(hash);
return false;
});
I know that problem line is totally wrong. I basically want to let the server side know from which the submission came from. Can anyone help?
Upvotes: 2
Views: 485
Reputation: 359816
You're very, very close. This will work:
d.push("field=" + this.id);
Or, to be consistent with the other array elements:
d.push({field: this.id});
Upvotes: 1