Advertisement
Guest User

Untitled

a guest
Sep 12th, 2010
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).ready(function()
  2. {
  3.     $("#number").blur(function()
  4.     {
  5.         $("#msgbox").removeClass().addClass('messagebox').text('Checking').fadeIn("slow");
  6.         //check the username exists ajax
  7.         $.post("user_availability.php",{ user_name:$(this).val() } ,function(data)
  8.         {
  9.           if(data=="no") //if username not avaiable
  10.           {
  11.             $("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
  12.             {
  13.               $(this).html('<img src="img/off.png" alt="Number registered" />').addClass('messageboxerror').fadeTo(900,1);
  14.             });    
  15.           }
  16.           else
  17.           {
  18.             $("#msgbox").fadeTo(200,0.1,function()  //start fading the messagebox
  19.             {
  20.               $(this).html('<img src="img/on.png" alt="Number unregistered" />').addClass('messageboxok').fadeTo(900,1);   
  21.             });
  22.           }
  23.                
  24.         });
  25.  
  26.     });
  27. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement