daily pastebin goal
54%
SHARE
TWEET

Untitled

a guest Jan 14th, 2018 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var showError = function(ctx, msgKey) {
  2.     var errorContainer = document.createElement("p");
  3.     errorContainer.setAttribute("class", "error");
  4.  
  5.     //First remove any error messages so we do not duplicate
  6.     ctx.next(".error").remove();
  7.     $(errorContainer).append(i18n.msgStore[msgKey]).insertAfter(ctx);
  8. };
  9.  
  10. $("#email").blur(function(event) {
  11.  
  12.     var emailErr = $(this).next(".error");
  13.  
  14.     if($.trim($(this).val()) === "") {
  15.         showError($(this), "emailInvalid");
  16.     } else if(emailErr) {
  17.         emailErr.remove();
  18.     }
  19. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top