Magento Forum

   
Newsletter in pop using ajax
 
WorldWideDev
Jr. Member
 
Total Posts:  17
Joined:  2008-09-30
 

Hello all,

thanks for taking the time to view this topic.

So I have code for the newsletter sign up coded on a CMS page.

Problem Im having is you can leave email address field blank, hit button and see the next view that is controlled by the ajax code within it.

It tried to validate giving the red message, you see that one second, but then shows the confirmation message.

If anyone could help with I’d appreciate, Im new to magento and ajax coding, so maybe I have done something wrong or left something out.

any ideas or suggestions?

see code below

<div id="pop-confirm" style="display: none;">
<h1 style="color: #000000; font-weight: bold;">THANKS!</h1>
<p> </p>
<h2>Use code: <strong>extra15</strong><br /> for 15% off your purchase.</h2>
</div>
<form id="newsletter-validate-detail" action="home/send" method="post" onsubmit="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;">
<div class="block-content">
<h2>ENTER YOUR EMAIL<br /> AND GET</h2>
<div class="form-subscribe-header">
<h1>15% OFF</h1>
<br />
<h1>EVERYTHING!</h1>
</div>
<div class="input-box"><input id="newsletter" class="input-text required-entry validate-email” title="Sign up for our newsletter” type="text" name="email" /></div>
<br />
<div class="actions"><button class="button" title="Get Code” type="submit"><span><span>Get Code</span></span></button></div>
<br />
<p><em>* Promotion ends April 6th</em></p>
</div>
</form>
<script type="text/javascript\">// <![CDATA[
var newsletterSubscriberFormDetail = new VarienForm(’newsletter-validate-detail’);
// ]]></script>

craig

 
Magento Community Magento Community
Magento Community
Magento Community
 
WorldWideDev
Jr. Member
 
Total Posts:  17
Joined:  2008-09-30
 

anyone? help??

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top