Advertisement
Guest User

Untitled

a guest
Oct 6th, 2012
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         var lowerCase= new RegExp(/^[a-z ,-]+$/);
  2.        
  3.         $(this).removeClass("active");         
  4.  
  5.         if(!$(this).val().match(lowerCase))
  6.         {
  7.             $("#firstNameErrorMsg").html("First name can only contain letters.");
  8.         }
  9.         if($(this).val() == "")
  10.         {
  11.             $("#firstNameErrorMsg").html("Please enter your first name.");
  12.         }  
  13.         else
  14.         {
  15.             $("#firstNameErrorMsg").html("OK");
  16.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement