So I'm turning an "edit" form into an ajaxForm with the following:
$('#reviewForm').ajaxForm({
success: function (response) {
$('#bookReview').html(response);
}
});
This returns the same form, that can be edited again, if necessary. The second form submission, however, no longer has the ajaxForm() attached to it, which makes sense.
How do I make sure this form is always an ajaxForm, no matter how many submissions have taken place, similar to how the live() function works?
$('#myFormId').live('submit', function() {
// submit the form
$(this).ajaxSubmit();
// return false to prevent normal browser submit and page navigation
return false;
});
Sligtly modified example for ajaxSubmit from http://jquery.malsup.com/form/#api.