Jquery post timing issue

Jquery post timing issue

Hi,

My problem:

I have 2 functions like this:

  1. function submitForm()
  2. {
  3. // submit form
  4. }


  5. function doPost()
  6.  {
  7. // do a post 
  8. }

  9. function Login()
  10. {
  11. doPost();
  12. submitForm();

  13. }

So my problem is that the doPost() function doesn't get properly executed, it only works if there is an alert function in it. I tried using the success function of the post to execute the submitForm() function, but it also didn't work properly.

Can somebody point me in the right direction.
I appreciate any help.

Thanks,

Erik