It is because you get rid of the form when you replace the message inside #form before calling serialize(). Move this line $("#form").html('Please wait...');
below everything else, and serialize() will no longer return empty. Ted On Fri, Jul 17, 2009 at 2:54 PM, robotwink <robotw...@gmail.com> wrote: > > Hello, > > I tried for hours and no luck. Here's my code: > > http://stikked.com/view/4d9c1242 > > I would really appreciate if anyone can tell me why $ > ("#contact_form").serialize() is always returning empty string. > > On Jul 16, 2:26 pm, James <james.gp....@gmail.com> wrote: > > Could you define "not working"? > > > > Are there any error messages? > > Is $("#contact_form").serialize() not giving the right values? > > Is the AJAX request not being sent? > > Is there no response coming back from the AJAX request? > > > > Try adding an 'error' callback also to see if it gets called. > > > > On Jul 15, 6:24 pm,robotwink<robotw...@gmail.com> wrote: > > > > > > > > > Hi guys, > > > > > I need to send the whole form to the server for processing. I have > > > this now, which is not working: > > > > > $.ajax({ > > > type: "POST", > > > url: "file.php", > > > data: $("#contact_form").serialize(), > > > success: function(data){ > > > alert('ok'); > > > } > > > }); > > > > > Please let me what's wrong and how to fix it. Thanks. >