javascript - Magento - AJAX newsletter validate e-mails that already exist in the database -
i'm using ajax validation
doesn't validate if e-mail exists in database. goes through if entered valid e-mail address:
onsubmit="if(newslettersubscriberformdetail.validator.validate()) { new ajax.updater({success:'newsletter-validate-detail'}, 'newsletter/subscriber/new', { asynchronous:true, evalscripts:false, oncomplete:function(request, json) { element.hide('newsletter-validate-detail');element.show('pop-confirm'); }, onloading:function(request, json){}, parameters:form.serialize(this) }); } return false;"
i have tried modify onsubmit function, no avail. hope here can teach me how make validation work check if entered e-mail exists.
this standard magento behavior. doesn't check if email exists , says "thank subscription".
you can check in mage_newsletter_subscribercontroller
in newaction
it'll check existing email if you're logged in , try enter else's email address :
if ($ownerid !== null && $ownerid != $customersession->getid()) { mage::throwexception($this->__('this email address assigned user.')); }
you'll need rewrite method achieve 'email exists' error.
Comments
Post a Comment