[jQuery] Form Plugin and AJAX DOM binding
Hello all,
I have a situation that I keep bumping into and not sure what the
proper way to handle. I have function to submit a request to update a
customer's profile from a form and on the way in, I am bringing a new
DIV inside the target DIV, but since it is new DIV the DOM doesn't
know it is there (I suspect). How do I get things like this auto
rebinded? What I am trying to do is after the success is loaded: $
('#customerEditDiv').find('#success').pause(4000).fadeOut('slow');
But it never fires. I constantly seem to be battling binding issues. I
must be doing something wrong in the grand scheme of things. Here is
what the main function looks like:
bindCustomer = function(){
$('#customerEditDiv').find('#editCustomer').one('submit', function()
{
showSpinner();
$('#editCustomer').ajaxSubmit({
target: '#customerEditDiv',
url: '/admin/updatecustomer',
method: 'post',
success: function(){
bindCustomer();
$('#customerEditDiv').fadeIn('slow');
$("#mainDetail").loadIfModified("/admin/mainDetail");
billReset(); //rebind billing form
shipReset(); // rebind shipping form
hideSpinner();
$
('#customerEditDiv').find('#success').pause(4000).fadeOut('slow');
}
});
return false;
bindStatus(); // rebind status form
});
}
Any help greatly appreciated.
-Alex