Q:

jquery validation - waiting for remote check to complete

When I call $("form").valid() I have a remote validation check hooked up (which all works well) however if all other fields are valid the form passes validation because the remote check hasn't return a response "quick enough". 
Is there a way to either force jquery validation to wait for any remote checks to be completed or hook into the complete event of the remote check call?
I am currently using the remote validator built into the jQuery validation framework http://docs.jquery.com/Plugins/Validation/Methods/remote

A:

one way is to introduce a variable that will be set to true when the remote call comes back 
var remote_complete = false;

$.ajax({
  url: "test.html",
  success: function(){
    remote_complete = true;
  }
});

while (remote_complete == false)
  {
  // loop until  remote_complete = true;
  }

Another way is to validate your form after remote validation completes
 $.ajax({
      url: "test.html",
      success: function(){
        validate_form();
      }
    });

