X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Add an extra email address field on registration form (https://forum.x-cart.com/showthread.php?t=29825)

PuroPlacer 03-20-2007 05:38 AM

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 03-23-2007 02:40 AM

Re: Add an extra email address field on registration form
 
anyone?

PuroPlacer 03-26-2007 09:05 AM

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?

PhilJ 03-26-2007 10:17 AM

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>


Online Michael 05-19-2007 08:10 PM

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.

2coolbaby 10-17-2007 02:42 PM

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:-)

unimatrix 10-30-2007 01:51 PM

Re: Add an extra email address field on registration form
 
Works fine on 4.1.7- thank you

leagcyteam2 10-30-2007 03:29 PM

Re: Add an extra email address field on registration form
 
Awesome work! Works super!

carpeperdiem 10-30-2007 07:21 PM

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

Thedae2k 07-29-2008 01:52 AM

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.


All times are GMT -8. The time now is 04:50 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.