Showing posts with label confirmation email. Show all posts
Showing posts with label confirmation email. Show all posts

Thursday, September 8, 2011

How to Add Confirmation email field in magento registration form using class validate-cemail?

The following method allows you to add confirmation email address field in your customer registration or newsletter page.
Create a javascript file called validation.js under "js/email/validation.js"
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')) {
                    pass = $('email');
                }
  confirm =conf.value;
  if(!confirm && $('email2'))
  {
  confirm = $('email2').value;
  }
                return (pass.value == confirm);
            }],
]); 
Add the new js file into your customer.xml file

    
 
On the register form add a new field to contain the email confirmation field "template/customer/form/register.phtml".

Thats all. You are done.