Jump to content

contact form email verify


Recommended Posts

G'day

I have been having problems with clients entering in their emails incorrectly into the contact form. I want to know if it is possible to add in another box on the form that makes them enter their emails again and if there is a difference between the two email boxes it will let them know.

thanks for the help.

Link to comment
Share on other sites

  • 5 months later...

Hey all,

To make this happen follow the below steps.


1. Open /yourstore/yourtheme/contact-form.tpl
2. Find the code below:



{l s='E-mail address'}
    <input type="text" id="email" name="from" value="{$email}" />


3. Place the below code UNDER the code in step 2.



{l s='E-mail address confirmation'}
   <input type="text" id="email" name="email_confirm" value="{$email_confirm}" />


4. Save the file and close the file - upload it to your server.
5. Open the file: /yourstore/contact-form.php
6. Look for the code (around lines 14-15):

if (!($from = Tools::getValue('from')) OR !Validate::isEmail($from))
   $errors[] = Tools::displayError('invalid e-mail address');


7. Add the below code UNDER the code in step 6.

if(Tools::getValue('from') != Tools::getValue('email_confirm'))
    $errors[] = Tools::displayError('your email addresses do not match');



It should look like this:

if (!($from = Tools::getValue('from')) OR !Validate::isEmail($from))
   $errors[] = Tools::displayError('invalid e-mail address');
if(Tools::getValue('from') != Tools::getValue('email_confirm'))
   $errors[] = Tools::displayError('your email addresses do not match');



8. Save the file and upload it to your server.

Your done :-)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...