Discussion:
Jquery form plugin can't find resolution
NHARRY
2010-02-14 14:58:08 UTC
Permalink
I have a form that is loaded using .load it is then posted using the
jquery form plugin. But it won't post see code:


<script type="text/javascript">
$(document).ready(function() {
//shows loading screen whilst posting via ajax
$().ajaxStart($.blockUI).ajaxStop($.unblockUI);

//post form add_customer ajax
var options = {
target: '#alert',
};
$('#add_customer').submit(function() {
$(this).ajaxSubmit(options);
return false;
});

//load form
$('#theform').hide().load('form.php', function() {
$(this).fadeIn();
return false;
});

});
</script>

I am sure there are others that have had this problem. Help ismuch
appreciated.
Marty Jones
2010-02-15 12:31:46 UTC
Permalink
Instead of doing $(this).ajaxSubmit(options);

try

$('#formId').ajaxSubmit(options);

where #formId is the id of the form you are submitting.
Post by NHARRY
I have a form that is loaded using .load it is then posted using the
 <script type="text/javascript">
$(document).ready(function() {
        //shows loading screen whilst posting via ajax
        $().ajaxStart($.blockUI).ajaxStop($.unblockUI);
        //post form add_customer ajax
        var options = {
        target: '#alert',
    };
           $('#add_customer').submit(function() {
                $(this).ajaxSubmit(options);
                return false;
            });
//load form
$('#theform').hide().load('form.php', function() {
$(this).fadeIn();
 return false;
});
});
    </script>
I am sure there are others that have had this problem. Help ismuch
appreciated.
Loading...