title: .post inside jQuery.validator.addMethod always returns false
body: <p>I am very new to jQuery and javascript programming. I have a program below that checks whether username is taken or not. For now, the PHP script always returns </p>
  
  <pre><code>  if(isset($_POST["username"]) )//&amp;&amp; isset($_POST["checking"]))
      {
          $xml="&lt;register&gt;&lt;message&gt;Available&lt;/message&gt;&lt;/register&gt;";
          echo $xml;
      }
  </code></pre>
  
  <p>Login function works, but username checking doesn't. Any ideas?
  Here is all of my code:</p>
  
  <pre><code>$(document).ready(function() {
  jQuery.validator.addMethod("checkAvailability",function(value,element){
      $.post( "login.php" , {username:"test", checking:"yes"}, function(xml){
          if($("message", xml).text() == "Available") return true;
          else return false;
      });
  },"Sorry, this user name is not available");
  $("#loginForm").validate({
      rules:  {
          username: {
              required: true,
              minlength: 4,
              checkAvailability: true
          },
          password:{
              required: true,
              minlength: 5
          }
      },
      messages: {
          username:{
              required: "You need to enter a username." ,
              minlength: jQuery.format("Your username should be at least {0} characters long.")
          }
      },
      highlight: function(element, errorClass) {
                  $(element).fadeOut("fast",function() {
                  $(element).fadeIn("slow");
                  })
      },
      success: function(x){
          x.text("OK!")
      },
      submitHandler: function(form){send()}
  });
  function send(){
      $("#message").hide("fast");
      $.post( "login.php" , {username:$("#username").val(), password:$("#password").val()}, function(xml){
          $("#message").html( $("message", xml).text() );
          if($("message", xml).text() == "You are successfully logged in.")
          {
              $("#message").css({ "color": "green" });
              $("#message").fadeIn("slow", function(){location.reload(true);});
          }
          else
          {
              $("#message").css({ "color": "red" });
              $("#message").fadeIn("slow");
          }
      });
  }
  $("#newUser").click(function(){
  
      return false;
  });
  </code></pre>
  
  <p>});</p>