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_subscribercontrollerin 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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -