View Single Post
  #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