Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Add an extra email address field on registration form

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-20-2007, 05:38 AM
 
PuroPlacer PuroPlacer is offline
 

Advanced Member
  
Join Date: Jan 2007
Location: Marbella, Spain
Posts: 61
 

Default Add an extra email address field on registration form

Has anyone added an extra email address field on the registration form? This is for making sure the email addresses entered are the same. The second field should check against the first one and then validate.

Can anyone help?
__________________
PuroPlacer
X-Cart version
X-Cart Pro 4.1.5
Reply With Quote
  #2  
Old 03-23-2007, 02:40 AM
 
PuroPlacer PuroPlacer is offline
 

Advanced Member
  
Join Date: Jan 2007
Location: Marbella, Spain
Posts: 61
 

Default Re: Add an extra email address field on registration form

anyone?
__________________
PuroPlacer
X-Cart version
X-Cart Pro 4.1.5
Reply With Quote
  #3  
Old 03-26-2007, 09:05 AM
 
PuroPlacer PuroPlacer is offline
 

Advanced Member
  
Join Date: Jan 2007
Location: Marbella, Spain
Posts: 61
 

Default Re: Add an extra email address field on registration form

Again:

Has anyone added an extra email address field on the registration form? This is for making sure the email addresses entered are the same. The second field should check against the first one and then validate.
Can anyone help?
__________________
PuroPlacer
X-Cart version
X-Cart Pro 4.1.5
Reply With Quote
  #4  
Old 03-26-2007, 10:17 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Re: Add an extra email address field on registration form

Here's a quick way of doing it, though not strictly validated (v4.1.x) ...

skin1/main/register_contact_info.tpl

after...

Code:
{if $default_fields.email.avail eq 'Y'}

add...

Code:
{literal} <script type="text/javascript" language="javascript"> function check_email(){ var theForm = document.forms['registerform']; var errMsg = ""; var setfocus = ""; if (theForm['email2'].value != theForm['email'].value){ errMsg = "E-Mail confirmation does not match!"; setfocus = "['email2']"; } if (errMsg != ""){ alert(errMsg); eval("theForm" + setfocus + ".focus()"); } } </script> {/literal}

Then after,

Code:
<tr> <td align="right">{$lng.lbl_email}</td> <td>{if $default_fields.email.required eq 'Y'}<font class="Star">*</font>{else}&nbsp;{/if}</td> <td nowrap="nowrap"> <input type="text" id="email" name="email" size="32" maxlength="128" value="{$userinfo.email}" /> {if $emailerror ne "" or ($reg_error ne "" and $userinfo.email eq "" and $default_fields.email.required eq 'Y')}<font class="Star">&lt;&lt;</font>{/if} </td> </tr>

and before {/if}

add...

Code:
<tr> <td align="right">Confirm {$lng.lbl_email}</td> <td><font class="Star">*</font></td> <td nowrap="nowrap"> <input type="text" id="email2" name="email2" size="32" maxlength="128" value="" onBlur="check_email();" /> </td> </tr>
__________________
xcartmods.co.uk
Reply With Quote
  #5  
Old 05-19-2007, 08:10 PM
 
Online Michael Online Michael is offline
 

eXpert
  
Join Date: Mar 2005
Location: Melbourne, Australia
Posts: 273
 

Smile Re: Add an extra email address field on registration form

I just wanted to say thank you to PhilJ for this very useful piece of code. Well done and thank you once again.
__________________
X-Cart 5.3.5.4
Reply With Quote
  #6  
Old 10-17-2007, 02:42 PM
  2coolbaby's Avatar 
2coolbaby 2coolbaby is offline
 

eXpert
  
Join Date: Sep 2004
Location: TN moving to FL
Posts: 265
 

Default Re: Add an extra email address field on registration form

Thanks for that code. That helps stop people inputting the wrong email address, which they do all the time, then want to rant when they don't get their emails
__________________
Mary Lee
-------------------
Dinner and a Murder Mystery Games
http://www.dinnerandamurder.com

x-cart version 4.7.5 / Mac OS 10.10.5 and Windows 8/10 sometimes - Ideal Responsive Template
Reply With Quote
  #7  
Old 10-30-2007, 01:51 PM
  unimatrix's Avatar 
unimatrix unimatrix is offline
 

Member
  
Join Date: May 2007
Posts: 10
 

Default Re: Add an extra email address field on registration form

Works fine on 4.1.7- thank you
__________________
Running X-cart version 4.1.7
Reply With Quote
  #8  
Old 10-30-2007, 03:29 PM
 
leagcyteam2 leagcyteam2 is offline
 

Member
  
Join Date: Aug 2005
Posts: 25
 

Default Re: Add an extra email address field on registration form

Awesome work! Works super!
__________________
4.1.9
Reply With Quote
  #9  
Old 10-30-2007, 07:21 PM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Add an extra email address field on registration form

I love this script! HOWEVER....

Mac/Safari (2.0.4) - if the email doesn't match, the popup box becomes a "dialog box from hell" and will not go away until it is clicked at least 3 or 4 times.

No issues in Firefox (mac or win) or IE 6 or 7. The problem only occurs in Safari/mac.

Anyone know a workaround? Does anyone have a "better" javascript code that is newer/better/friendlier?

Thanks,

Jeremy
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #10  
Old 07-29-2008, 01:52 AM
 
Thedae2k Thedae2k is offline
 

eXpert
  
Join Date: Jan 2004
Posts: 288
 

Default Re: Add an extra email address field on registration form

Works great in 4.1.9

I see what you mean about the crazy dialog box...you just have to fix it first and then you can move on. It would be nice if safari allowed for you to scroll the screen at least before fixing your email.
__________________
X-Cart Pro 4.1.9
PHP5.2.5
MySQL 5.0.54
IIS/Apache/NGINX Webservers
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:38 AM.

   

 
X-Cart forums © 2001-2020