Guest User

Untitled

a guest
Oct 27th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. <script language="javascript">
  2. $(document).ready(function()
  3. {
  4. $("#login_form").submit(function()
  5. {
  6. $("#msgbox").removeClass().addClass('messagebox').text('Validating....').fadeIn(1000);
  7. $.post("ajax.php",{ username:$('#username').val(),password:$('#password').val(),rand:Math.random() } ,function(data)
  8. {
  9. if(data=='yes')
  10. {
  11. $("#msgbox").fadeTo(200,0.1,function()
  12. {
  13. $(this).html('Logging in.....').addClass('messageboxok').fadeTo(900,1,
  14. function()
  15. {
  16. document.location='main.php';
  17. });
  18.  
  19. });
  20. }
  21. else
  22. {
  23. $("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
  24. {
  25. $(this).html('Login attempt failed.').addClass('messageboxerror').fadeTo(900,1);
  26. });
  27. }
  28.  
  29. });
  30. return false;
  31. });
  32. $("#password").blur(function()
  33. {
  34. $("#login_form").trigger('submit');
  35. });
  36. });
  37. </script>
Add Comment
Please, Sign In to add comment