Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script language="javascript">
- $(document).ready(function()
- {
- $("#login_form").submit(function()
- {
- $("#msgbox").removeClass().addClass('messagebox').text('Validating....').fadeIn(1000);
- $.post("ajax.php",{ username:$('#username').val(),password:$('#password').val(),rand:Math.random() } ,function(data)
- {
- if(data=='yes')
- {
- $("#msgbox").fadeTo(200,0.1,function()
- {
- $(this).html('Logging in.....').addClass('messageboxok').fadeTo(900,1,
- function()
- {
- document.location='main.php';
- });
- });
- }
- else
- {
- $("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
- {
- $(this).html('Login attempt failed.').addClass('messageboxerror').fadeTo(900,1);
- });
- }
- });
- return false;
- });
- $("#password").blur(function()
- {
- $("#login_form").trigger('submit');
- });
- });
- </script>
Add Comment
Please, Sign In to add comment