Location: PHPKode > projects > Esvon Personals > esvon-personals/tpl/user_email_change.htm
<!-- TITLE: E-mail Address Change -->

<center>

<!-- TPL_INSERT : b_User_Menu -->
<!-- TPL_CELL : def -->

##USER_MENU##

<!-- /TPL_CELL : def -->
<!-- /TPL_INSERT : b_User_Menu -->

</center>


<form method=post name=frm>

<input name=email type=hidden value="##email##">

<table width="100%" align=center>
<tr>
  <td colspan=2 align=center>

<p class=pagetitle align=left>E-mail Address Change</p>

<span class=err>##err_msg##</span>

  </td>
</tr>

<tr>
  <td colspan=2><b><font class=txt8>
<ul>
<li> To change the email address on your account, we will need to verify that you can receive emails at your new email address, from our server
<li> Please provide a valid e-mail address, as you will have to confirm it before email update
</ul>

  </td>
</tr>

<tr>
<td align=right><b>
New e-mail: 
</td>
<td>
<input name=email1 size=30 value="##email1##">
</td>
</tr>
<tr>
<td nowrap align=right><b>
Re-enter e-mail:&nbsp;
</td>
<td><input name=email2 size=30 value="##email2##"></td>
</tr>

<tr height=30><td align=center colspan=2>
  <input type=button value="Submit" class="button" name=go onClick="goEmailChange()">
  </td>
</tr>

</table>


</form>


<script>

function goEmailChange(){
  var f = document.frm;
  var err_msg = '';

  if(f.email1.value != f.email2.value) err_msg  = 'E-mail addresses do not match';
  else if(isBadEmail(f.email1.value)) err_msg  = 'Invalid e-mail address';
  else if(f.email.value == f.email1.value) err_msg  = 'New e-mail address matches the old one';
  if(err_msg) alert(err_msg);
  else f.submit();
}

 function isBadEmail(strg) {
    email_array = strg.split('@');
    if (email_array.length != 2) return true;
    if (email_array[1].split(".").length < 2) return true;
    if (email_array[1].split(".")[1].length < 1) return true;
    if (strg.indexOf('@') < 1) return true;
    if (email_array[1].indexOf('.') < 1) return true;
    if (strg.length < 5) return true;
    return false;
  }

/*function renderEmailChange(show){
  var b1, b2;
  if(show){ b1='profile'; b2='emails'; }
  else { b2='profile'; b1='emails'; }
  SwitchBlock(b1, 0);
  SwitchBlock(b2, 1);
}*/

</script>
Return current item: Esvon Personals