If you are talking about the jquery form plugin , your code should look something like this:
$(function() { $('#idofyourform').ajaxForm(function(result) { alert('form successfully submitted'); }); });
If not, then make sure you encode the request correctly:
$.ajax({ type: "post", url: "qsubmit.php", data: { q1: 'value 1', q2: 'value 2' }, success: function(result) { alert('form successfully submitted'); } });
or if you want to submit the contents of the form:
$.ajax({ type: "post", url: "qsubmit.php", data: $('#idoftheform').serialize(), success: function(result) { alert('form successfully submitted'); } });
Finally, make sure you install FireBug to better analyze what happens under the covers.
source share