Advertisement
nocturnalmk

Untitled

Nov 4th, 2012
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).ready(function() {
  2.    
  3.     function displayMessage(where, type, message) {
  4.         $(where).hide();
  5.         $(where).addClass("alert");
  6.         $(where).addClass("alert-"+type);
  7.        
  8.         if (type == "error") {
  9.             $(where).text("<i class=\"icon-warning-sign\"></i>");
  10.         }
  11.         $(where).text(message);
  12.         $(where).fadeIn('slow');
  13.     }
  14.    
  15.     $("#enter-subject").click(function() {
  16.        
  17.         var code = $("#enter-subject-code").val();
  18.  
  19.         if (!validCode(code)) {
  20.             displayMessage("#enter-subject-error", "error", "Внесовте погрешен код. Обидете се повторно");
  21.  
  22.             return false;
  23.         }
  24.        
  25.     });
  26.    
  27.    
  28. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement