View Single Post
  #12  
Old 12-30-2011, 09:01 AM
 
delphi delphi is offline
 

Senior Member
  
Join Date: Jul 2004
Posts: 185
 

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

Quote:
Originally Posted by PhilJ
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>

This does not work on Chrome because it pops up a bunch of dialogs and no way to close them ...

Any hint how to fix this?
__________________
X-Cart Gold version 4.4.4
X-Cart directory /home/web/u/ugchweb/cart
PHP 5
MySQL server 5
Reply With Quote