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


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


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


<form method=post name=frm>

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

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

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

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


  <td colspan=2><b><font class=txt8>
<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


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

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




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

Return current item: Esvon Personals