Location: PHPKode > projects > phpLedMailer > templates/unsubscribe.html
<script language="javascript">
	function validateForm( )
	{
		var frm = document.frmMain;

		if(! ValidateEmail(frm.emailaddr) )
		{
			return false;
		}

		return true;
	}

	function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true
	}

	function ValidateEmail(emailID){
		if ((emailID.value==null)||(emailID.value=="")){
			alert("Please Enter your Email ID")
			emailID.focus()
			return false
		}
		if (echeck(emailID.value)==false){
			emailID.value=""
			emailID.focus()
			return false
		}
		return true
	 }
</script><title>UnSubscribe from Mailing List</title>
<body bgcolor="#FFFFFF" text="#000000">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">Unsubscribe 
  from {listname}<br>
  <br>
  </font></div>
  <form name="frmMain" method="POST" action="{form_action}">
  <table border=0 bgcolor="#000000" cellspacing="1" align="center" width="450">
    <tr bgcolor="#FFFFFF"> 
      <td><font face="Arial, Helvetica, sans-serif" size="2">Enter E-Mail Address:</font></td>
      <td> <font face="Arial, Helvetica, sans-serif" size="2"> 
        <input type="text" name="emailaddr" size="30">
        </font></td>
    </tr>
    <tr bgcolor="#FFFFFF" align="center"> 
      <td colspan=2> <font face="Arial, Helvetica, sans-serif" size="2"> 
        <input type="submit" value="Unsubscribe from mailing list" onclick="return validateForm( )">
        </font></td>
</table>
  </form>
Return current item: phpLedMailer