I have been using the jquery form plugin to submi forms on my page and it works great.
But when I try to submit a form that has been loaded using .load it doesn't work.
This is my code:
$(document).ready(function() {
//shows loading screen whilst posting via ajax
$().ajaxStart($.blockUI).ajaxStop($.unblockUI);
//post form add_customer ajax
var options = {
target: '#alert',
};
$.ajaxSettings.cache = false;
$('#add_customer').submit(function() {
$(this).ajaxSubmit(options);
return false;
});
$('#theform').hide().load('form.php', function() {
$(this).fadeIn();
return false;
});
});
What am I missing? can't find a solution anywhere.