Remote validation not working

Remote validation not working

Hi,
I am stuck at using Jquery remote validation plugin.
I have implemented a wizard using jquery accordion based on http://jquery.bassistance.de/validate/demo/multipart/ and its 3rd step contains a companyCode field. This field is  a required unique field so I need to validate this field using remote option of jquery validate plugin.
Here is my code.
  1.     jQuery.validator.addMethod('checkCompanyCode', function(companyCode) {
  2.         var result = false;
  3.         $.ajax({
  4.             cache:false,
  5.             async:false,
  6.             type: 'POST',
  7.             data:'companyCode=' + companyCode,
  8.             url: 'checkCompanyCode',
  9.             success: function(json) {
  10.                 result = json.validationPassed;//returns boolean value

  11.             }
  12.         });
  13.         return result;
  14.     }, '');
I have verified that this code is working fine and remote call is made to server which returns appropriate boolean values to be used in jquery validate remote function.

Here is my validation code which also disables onfocusout and onkeyup because its remote validation hits server on each key.
  1.     var validator = $('#createOrganizationForm').validate({
  2.         onfocusout: function(element) {
  3.             return $(element) != $('#companyCode');
  4.         },
  5.         onkeyup: function(element) {
  6.             return $(element) != $('#companyCode');
  7.         },
  8.         rules:{
  9.             companyCode:{
  10.                 required:true,
  11.                 checkCompanyCode:true
  12.             }
  13.         },
  14.         messages:{
  15.             companyCode:{
  16.                 required:"Company code is a required field.",
  17.                 checkCompanyCode: "This company code is already taken, please enter a different company code."
  18.             }
  19.         }
  20.     });
I can see that only required rule is being validated but while making remote call to my server jquery validate plugin does not validate the companyCode field properly even if my server and validation method described above returns correct value to be used. It just passes the validation and user is able to move to next step of wizard even if current step is invalid.

Also, not a blocker for me but ajax call for remote validation is being made at every step of wizard and entire form is being validated at each step. Is there any way I can validate the subset of form elements which are present on the current step only. 

I am validating the form steps like this
  1.     var currentIndex = 0; // global variable to keep the current index;
  2.     var WIZARD_PAGE_COUNT = 3; //global variable for panel count. This is zero based count
  3.     var wizard = $("#stepForm").accordion({
  4.         animated: false,
  5.         change: function (event, ui) {
  6.             currentIndex = $(this).find("h3").index(ui.newHeader[0]);
  7.         }
  8.     });

  1.     //Bind event for previous and next buttons
  2.     $('.previous,.next').click(function () {
  3.         var index = 0;
  4.         if ($(this).hasClass('next')) {
  5.             if (validator.form()) {
  6.                 index = currentIndex + 1;
  7.                 if (index > WIZARD_PAGE_COUNT) {
  8.                     index = WIZARD_PAGE_COUNT;
  9.                 }
  10.                 wizard.accordion("activate", index);
  11.             }
  12.         } else {
  13.             index = currentIndex - 1;
  14.             if (index < 0) {
  15.                 index = 0;
  16.             }
  17.             wizard.accordion("activate", index);
  18.         }
  19.     });

I have already tried all forms of jquery remote validation explained in the examples given at http://jquery.bassistance.de/validate/demo/ but nothing has worked for me.

Can anybody please help me out. I have attached code file as well which contains some other unrelated code.

Thanks in advance.
Ahsan