I have the following jQuery code:
$(".save_button").click(function() {
var $form = $(this).closest("div.info_section").find("form");
url = $form.attr("action");
$.post(url, $form.serialize(),
function() {
// need to figure out a way to distinguish the form being saved
}
);
});
I have three forms (on the same page) that are tied to this function. The success callback function of $.post requires a way to distinguish which form is being submitted. Please advise how I would do so. Thanks.
You could use the
$formvariable inside thesuccesscallback: