Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var showError = function(ctx, msgKey) {
- var errorContainer = document.createElement("p");
- errorContainer.setAttribute("class", "error");
- //First remove any error messages so we do not duplicate
- ctx.next(".error").remove();
- $(errorContainer).append(i18n.msgStore[msgKey]).insertAfter(ctx);
- };
- $("#email").blur(function(event) {
- var emailErr = $(this).next(".error");
- if($.trim($(this).val()) === "") {
- showError($(this), "emailInvalid");
- } else if(emailErr) {
- emailErr.remove();
- }
- });
Add Comment
Please, Sign In to add comment