cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Email Confirmation field to registration page

Adding Email Confirmation field to registration page

I've followed many instructions and cannot seem to get it to show up.  

 

I created a new validation.js in a new directory called js/email/

 

It consists of:

Validation.addAllThese([  
  
    ['validate-cemail', 'Please make sure your emails match.', function(v) {  
                var conf = $('confirmation') ? $('confirmation') : $$('.validate-cemail')[0];  
                var pass = false;  
  var confirm;  
                if ($('email_address')) {  
                    pass = $('email_address');  
                }  
  confirm =conf.value;  
  if(!confirm && $('email_address2'))  
  {  
  confirm = $('email_address2').value;  
  }  
                return (pass.value == confirm);  
            }],  
]);   

I added the following to customer.xml  (/app/design/frontend/base/default/layout/customer.xml)

<reference name="head">  
    <action method="addJs"><script>email/validation.js</script></action>  
</reference>   

(I added it on line 131 under the "New Customer Registration" section)

 

I added:

<label class="required" for="email_address"><em>*</em><?php echo $this->__('Confirm Email Address') ?></label>  
<div class="input-box"> 
<input class="input-text required-entry validate-cemail" title="<?php echo $this->__('Confirm Email') ?>" id="email_address2" name="confirm_email" type="text">  
</div>  

to /app/design/frontend/base/default/template/customer/form/register.phtml  directly below the regular email address field.

 

What am I doing wrong that won't make it show up?

4 REPLIES 4

Re: Adding Email Confirmation field to registration page

vi_daft,

You may also have to add your form field code to your version of app/design/frontend/base/default/template/persistent/customer/form/register.phtml

 

Also, you should ensure that you don't actually modify 'base/default' templates since the changes will get lost if you ever upgrade.

 

Instead you should copy the file into your own theme.

 

Let us know how it goes.

 

Problem solved? Click Accept as Solution!
Magento Certified Developer Plus | www.iwebsolutions.co.uk | Magento Small Business Partner

Re: Adding Email Confirmation field to registration page

So you're saying I should copy the 

app/design/frontend/base/default/template/persistent/customer/form/register.phtml file

into

app/design/frontend/ultimo/default/template/persistent/customer/form/register.phtml

even though it's not currently in there?  

Re: Adding Email Confirmation field to registration page

Hi,

Yes - thats correct. You should never edit anything directly in the 'base' directory. Always copy it into your theme (or edit it if its already in there)

 

Regards,

Andrew

Problem solved? Click Accept as Solution!
Magento Certified Developer Plus | www.iwebsolutions.co.uk | Magento Small Business Partner

Re: Adding Email Confirmation field to registration page

Thank you for this useful tip.  I still can't seem to get the field to appear, however it's good to know this for future reference. Man Happy