title: Ajax Live Database check
body: <p>I am making a registration table which will check if the cellphone number typed is in use like in twitter's username check. My code looks perfect but I keep getting 'Checking number availability' its like ajax is not POSTing my requests. Help Please :-)
  here is the relevant ajax code bits</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function()//When the dom is ready 
  {
  $("#cellphone_number").change(function() 
  { //if theres a change in the username textbox
  
  var phonenumber = $("#cellphone_number").val();//Get the value in the username textbox
  if(phonenumber.length == 13)//if the lenght equal to 13 characters
  {
  $("#availability_status").html('&lt;align="absmiddle"&gt;&lt;font color="#00FF33"&gt;Checking Number availability...&lt;/font&gt;');
  //Add a loading image in the span id="availability_status"
  
  $.ajax({  //Make the Ajax Request
      type: "POST", 
      url: "../Functions/ajax_check_number.php",  //file name
      data: ("number="+phonenumber),  //data
      success: function(server_response)
      {     
     $("#availability_status").ajaxComplete(function(event, request){ 
  
      if(server_response == '0')//if ajax_check_username.php return value "0"
      { 
      $("#availability_status").html('&lt;align="absmiddle"&gt; &lt;font color="#00FF33"&gt;Number is Available &lt;/font&gt;  ');
      //add this image to the span with id "availability_status"
      }  
      else  if(server_response == '1')//if it returns "1"
      {  
       $("#availability_status").html('&lt;align="absmiddle"&gt; &lt;font color="#FF0000"&gt;Number already in use&lt;/font&gt;');
      }  
  
     });
     } 
  
    }); 
  
  }
  else
  {
  
  $("#availability_status").html('&lt;font color="#FF0000"&gt;Number too short&lt;/font&gt;');
  //if in case the username is less than or equal 3 characters only 
  }
  
  return false;
  });
  
  });
  &lt;/script&gt;
  </code></pre>