Email Shopping Cart

$('.eCTextarea').on('focus', function(){ if(this.innerText === $(this).attr('placeholder')) this.innerText = ""; }); $('.eCInput, .eCTextarea').placeholder(); var EmailSC = $('.email_shopping_cart'); EmailSC.on('submit', function(e){ e.preventDefault(); $(this).find('[placeholder]').each(function(){ var $this = $(this) ; if($this.val() === $this.attr('placeholder')) $this.val(''); }); if ( EmailSC.valid() ) { $.get(EmailSC.attr('action'), $(this).serialize(), function(data){ $("#onePopupLayer").find("div.close").click(); }); }; }); EmailSC.validate({ rules: { cartRecipientName: { required: true }, cartRecipientEmail: { required: true, email: true }, cartSenderName: { required: true }, cartSenderEmail: { required: true, email: true } }, messages: { cartRecipientName: { required: "The Recipient's Name is required" }, cartRecipientEmail: { required: "The Recipient's Email is required" }, cartSenderName: { required: "Your Name is required" }, cartSenderEmail: { required: "Your Email is required" } }, errorPlacement: function(error, element) { error.appendTo(element.next('.eCError')); } });