[How-To] Contact Form - Confirm Email Field Added
14 posts
• Page 1 of 1
[How-To] Contact Form - Confirm Email Field Added
Hi everyone i thought i would post that i have added a new field called Confirm Email so if they put an email in Email field but they put the wrong email in confirm email it will say something like "Doesnt Match" i am using Jquery for this
.
EDIT: OOPS forgot to add attachments
so here they are at bottomof post
Also i have only tested this on OC 1.5.1.1 but i believe should work on all the 1.5 releases or even below but it hasnt been tested so you could download something called Winmerge and compare the files to see if matches or what changes need to be made.
So here we go
Step 1: EDIT: catalog/controller/information/contact.php
Find:
Add After:
Then find:
Add After:
Find:
Add After:
Find:
Add After:
Now Edit: catalog/language/english/information/contact.php
Find:
Add After: $_['text_confirm_email'] = 'Confirm E-Mail:';
Find:
Add After:
Find:
Add After:
Edit: catalog/view/theme/default/template/information/contact.tpl
Find:
Replace with:
Find:
Add After:
Find:
Add After:
Find:
Add After:
Please find attached the two .js files and upload them to catalog/view/javascript/ also the file validation.js as all the information into it to add all the the same sort of styles for Name, Enquiry and even adding Subject and Phone. all you do is repeat the above steps but change to subject or phone etc. If you want me to post a full tutorial on adding all these please ask
If this doesn't work for you please let me know
EDIT: i will also try and post a VQmod of this so its easier and quicker for people just need to get used to it first lol
Kind Regards,
Aaron
.EDIT: OOPS forgot to add attachments
so here they are at bottomof postAlso i have only tested this on OC 1.5.1.1 but i believe should work on all the 1.5 releases or even below but it hasnt been tested so you could download something called Winmerge and compare the files to see if matches or what changes need to be made.
So here we go

Step 1: EDIT: catalog/controller/information/contact.php
Find:
- Code: Select all
$this->data['entry_email'] = $this->language->get('entry_email');
Add After:
- Code: Select all
$this->data['entry_confirm_email'] = $this->language->get('entry_confirm_email');
Then find:
- Code: Select all
if (isset($this->error['email'])) {
$this->data['error_email'] = $this->error['email'];
} else {
$this->data['error_email'] = '';
}
Add After:
- Code: Select all
if (isset($this->error['confirm_email'])) {
$this->data['error_confirm_email'] = $this->error['confirm_email'];
} else {
$this->data['error_confirm_email'] = '';
}
Find:
- Code: Select all
if (isset($this->request->post['email'])) {
$this->data['email'] = $this->request->post['email'];
} else {
$this->data['email'] = '';
}
Add After:
- Code: Select all
if (isset($this->request->post['confirm_email'])) {
$this->data['confirm_email'] = $this->request->post['confirm_email'];
} else {
$this->data['confirm_email'] = '';
}
Find:
- Code: Select all
if (!preg_match('/^[^\@]+@.*\.[a-z]{2,6}$/i', $this->request->post['email'])) {
$this->error['email'] = $this->language->get('error_email');
}
Add After:
- Code: Select all
if (!preg_match('/^[^\@]+@.*\.[a-z]{2,6}$/i', $this->request->post['confirm_email'])) {
$this->error['confirm_email'] = $this->language->get('error_confirm_email');
}
if ($this->request->post['confirm_email']!=$this->request->post['email']) {
$this->error['confirm_email'] = $this->language->get('error_format_confirm_email');
}
Now Edit: catalog/language/english/information/contact.php
Find:
- Code: Select all
$_['text_email'] = 'E-Mail:';
Add After: $_['text_confirm_email'] = 'Confirm E-Mail:';
Find:
- Code: Select all
$_['entry_email'] = 'E-Mail Address:<span class="required">*</span>';
Add After:
- Code: Select all
$_['entry_confirm_email'] = 'Confirm E-Mail Address:<span class="required">*</span>';
Find:
- Code: Select all
$_['error_email'] = 'E-Mail Address not in valid format!';
Add After:
- Code: Select all
$_['error_confirm_email'] = 'E-mail Address not in valid format!';
$_['error_format_confirm_email'] = 'E-mail Address does not match!';
Edit: catalog/view/theme/default/template/information/contact.tpl
Find:
- Code: Select all
<b><?php echo $entry_email; ?></b><br />
Replace with:
- Code: Select all
<label for="email"><?php echo $entry_email; ?></label><br />
Find:
- Code: Select all
<input name="email" type="text" value="<?php echo $email; ?>" />
- Code: Select all
<input id="email" name="email" type="text" value="<?php echo $email; ?>" />
Add After:
- Code: Select all
<span id="emailInfo">Valid E-mail please, you will need it to progress</span>
Find:
- Code: Select all
<?php if ($error_email) { ?>
<span class="error"><?php echo $error_email; ?></span>
<?php } ?>
<br />
Add After:
- Code: Select all
<label for="confirm_email"><?php echo $entry_confirm_email; ?></label><br />
<input id="confirm_email" name="confirm_email" type="text" value="<?php echo $confirm_email; ?>" />
<span id="confirm_emailInfo">Confirm Email Address</span>
<br />
<?php if ($error_confirm_email) { ?>
<span class="error"><?php echo $error_confirm_email; ?></span>
<?php } ?>
Find:
- Code: Select all
<?php echo $content_bottom; ?></div>
Add After:
- Code: Select all
<script type="text/javascript" src="catalog/view/javascript/jquery.js"></script>
<script type="text/javascript" src="catalog/view/javascript/validation.js"></script>
Please find attached the two .js files and upload them to catalog/view/javascript/ also the file validation.js as all the information into it to add all the the same sort of styles for Name, Enquiry and even adding Subject and Phone. all you do is repeat the above steps but change to subject or phone etc. If you want me to post a full tutorial on adding all these please ask

If this doesn't work for you please let me know

EDIT: i will also try and post a VQmod of this so its easier and quicker for people just need to get used to it first lol
Kind Regards,
Aaron
- aaron1988
- Posts: 256
- Joined: Thu Jan 27, 2011 2:03 am
Re: [How-To] Contact Form - Confirm Email Field Added
Heia Aaron,
Thanks for the great post...
I have had a go at puting it into a vqmod, but please check this out... it isn't working for some reason... i'm pretty new to vQmod so i have probabily stuffed it up... but have a look anyway...
Thanks Dude
Jem
Thanks for the great post...
I have had a go at puting it into a vqmod, but please check this out... it isn't working for some reason... i'm pretty new to vQmod so i have probabily stuffed it up... but have a look anyway...
Thanks Dude
Jem
- Attachments
-
Email Validation.xml- Please don't anyone else use this vQmod untill it is checked out.
- (5.25 KiB) Downloaded 74 times
If i have helped... please click here to donate
Bookstore (book store) mod
Template Override - Category Specific (vQmod)
Template Override - Brand Specific (vQmod)
How did you find out about us register question mod
Compulsory Login vQmod
zoom - Product Image - Auto on hover
Latest website
http://www.modehandcare.co.nz/hand-dryers/
Bookstore (book store) mod
Template Override - Category Specific (vQmod)
Template Override - Brand Specific (vQmod)
How did you find out about us register question mod
Compulsory Login vQmod
zoom - Product Image - Auto on hover
Latest website
http://www.modehandcare.co.nz/hand-dryers/
-

Jeremy Fisk - Posts: 924
- Joined: Thu Nov 11, 2010 10:11 am
- Location: New Zealand (Masterton, Wairarapa)
Re: [How-To] Contact Form - Confirm Email Field Added
Happy Coding!
Simon
------
Commercial Mods:
Google Merchant / Base XML Feed + Bing Shopping + Sitemaps - Automatic Friendly SEO URLs
Full List of UKSB Extensions and Mods
vQmod Generator - Develop & Test OpenCart on your Local Windows machine
Click here if I have helped you and you would like to make a donation
Simon
------
Commercial Mods:
Google Merchant / Base XML Feed + Bing Shopping + Sitemaps - Automatic Friendly SEO URLs
Full List of UKSB Extensions and Mods
vQmod Generator - Develop & Test OpenCart on your Local Windows machine
Click here if I have helped you and you would like to make a donation
-

uksitebuilder - Posts: 5602
- Joined: Thu Jun 09, 2011 3:37 pm
- Location: United Kindgom
Re: [How-To] Contact Form - Confirm Email Field Added
Hi Jem,
Try Simons vQmod Generator
.
and if that doesnt work then i will take a further look
.
Kind Regards,
Aaron
Try Simons vQmod Generator
.and if that doesnt work then i will take a further look
.Kind Regards,
Aaron
- aaron1988
- Posts: 256
- Joined: Thu Jan 27, 2011 2:03 am
Re: [How-To] Contact Form - Confirm Email Field Added
Hiya Aaron...
Thanks for your reply
Please note that i am trying on 1.5.0.2 and 1.4.9.5
Good luck
Jemz
Thanks for your reply
I have... see attachedTry Simons vQmod Generator.
Please note that i am trying on 1.5.0.2 and 1.4.9.5
Good luck
Jemz
- Attachments
-
Email.xml- Email validation vQmod
- (4.62 KiB) Downloaded 68 times
If i have helped... please click here to donate
Bookstore (book store) mod
Template Override - Category Specific (vQmod)
Template Override - Brand Specific (vQmod)
How did you find out about us register question mod
Compulsory Login vQmod
zoom - Product Image - Auto on hover
Latest website
http://www.modehandcare.co.nz/hand-dryers/
Bookstore (book store) mod
Template Override - Category Specific (vQmod)
Template Override - Brand Specific (vQmod)
How did you find out about us register question mod
Compulsory Login vQmod
zoom - Product Image - Auto on hover
Latest website
http://www.modehandcare.co.nz/hand-dryers/
-

Jeremy Fisk - Posts: 924
- Joined: Thu Nov 11, 2010 10:11 am
- Location: New Zealand (Masterton, Wairarapa)
Re: [How-To] Contact Form - Confirm Email Field Added
It didn't work for me in 1.5.1.3 :/
Any help?
Any help?
- spirit
- Posts: 296
- Joined: Fri Oct 01, 2010 11:40 pm
Re: [How-To] Contact Form - Confirm Email Field Added
Hi ok
i will look in the next few days when not at work lol
Thanks
Aaron
i will look in the next few days when not at work lolThanks
Aaron
- aaron1988
- Posts: 256
- Joined: Thu Jan 27, 2011 2:03 am
Re: [How-To] Contact Form - Confirm Email Field Added
aaron1988 wrote:Hi oki will look in the next few days when not at work lol
Thanks
Aaron
Thanks man!
I think that OC team need add this function officially because is very very useful

- spirit
- Posts: 296
- Joined: Fri Oct 01, 2010 11:40 pm
Re: [How-To] Contact Form - Confirm Email Field Added
Don't forget it 

- spirit
- Posts: 296
- Joined: Fri Oct 01, 2010 11:40 pm
Re: [How-To] Contact Form - Confirm Email Field Added
Somebody can help in this way?
It's very useful, no doubt
It's very useful, no doubt

- spirit
- Posts: 296
- Joined: Fri Oct 01, 2010 11:40 pm
Re: [How-To] Contact Form - Confirm Email Field Added
Hi,
I'm also interested in vqmod for v 1.5.1.3.
Is this available? Thanks for the reply. Kind regards, Remco
I'm also interested in vqmod for v 1.5.1.3.
Is this available? Thanks for the reply. Kind regards, Remco
- remcofaasse
- Posts: 48
- Joined: Sun Dec 04, 2011 6:20 pm
Re: [How-To] Contact Form - Confirm Email Field Added
Another vote for this for 1.5.1.3 as I have tried another similar to this but it didn't work so this would be great if it did..
- Klimskady
- Posts: 160
- Joined: Mon Jun 06, 2011 11:57 pm
Re: [How-To] Contact Form - Confirm Email Field Added
Hi Everyone,
I saw the requests to have this functionality in 1.5.1.3 and thought it was a good idea so I added it to my code and would like to share with the community.
However, I have added it to Simon's "Better Contact Form" (BCF) which I believe is a must have to prevent spamming. You can find his code here:
http://forum.opencart.com/viewtopic.php?f=131&t=35286
I have been using BCF (2.0 with editable inputs) for a while, so I don't know if I have the latest version, but I have clearly marked my modifications in the code so if needed the changes could be copied.
If you find any errors, please post here and I will fix them. I will pass my changes along to Simon to see if he can add it in his code.
Hope this helps,
Khalil
I saw the requests to have this functionality in 1.5.1.3 and thought it was a good idea so I added it to my code and would like to share with the community.
However, I have added it to Simon's "Better Contact Form" (BCF) which I believe is a must have to prevent spamming. You can find his code here:
http://forum.opencart.com/viewtopic.php?f=131&t=35286
I have been using BCF (2.0 with editable inputs) for a while, so I don't know if I have the latest version, but I have clearly marked my modifications in the code so if needed the changes could be copied.
If you find any errors, please post here and I will fix them. I will pass my changes along to Simon to see if he can add it in his code.
Hope this helps,
Khalil
- Attachments
-
uksb_better_contact_form_no_name.xml- "Better Contact Form" with confirm email
- (17.69 KiB) Downloaded 71 times
- khalilm
- Posts: 2
- Joined: Sat Sep 17, 2011 5:32 pm
Re: [How-To] Contact Form - Confirm Email Field Added
Does this fix work with 1.4.9.5 ?
- matte2k
- Posts: 119
- Joined: Thu Mar 01, 2012 11:07 am
14 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 12 guests













