You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

scripts.js 1020 B

4 years ago
12345678910111213141516171819202122232425262728293031
  1. jQuery(document).ready(function() {
  2. $('.page-container form').submit(function(){
  3. var username = $(this).find('.username').val();
  4. var password = $(this).find('.password').val();
  5. if(username == '') {
  6. $(this).find('.error').fadeOut('fast', function(){
  7. $(this).css('top', '27px');
  8. });
  9. $(this).find('.error').fadeIn('fast', function(){
  10. $(this).parent().find('.username').focus();
  11. });
  12. return false;
  13. }
  14. if(password == '') {
  15. $(this).find('.error').fadeOut('fast', function(){
  16. $(this).css('top', '96px');
  17. });
  18. $(this).find('.error').fadeIn('fast', function(){
  19. $(this).parent().find('.password').focus();
  20. });
  21. return false;
  22. }
  23. });
  24. $('.page-container form .username, .page-container form .password').keyup(function(){
  25. $(this).parent().find('.error').fadeOut('fast');
  26. });
  27. });