hello please send code for autoreply of email in contact form my contact form is :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Welcome </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">
<SCRIPT>//global variable for error flag
var errfound = false;
//function to validate by length
function ValidLength(item, len) {
   return (item.length >= len);
}
//function to validate an email address
function ValidEmail(item) {
   if (!ValidLength(item, 5)) return false;
   if (item.indexOf ('@', 0) == -1) return false;

   return true;
}
// display an error alert
function error(elem, text) {
// abort if we already found an error
   if (errfound) return;
   window.alert(text);
   elem.select();
   elem.focus();
   errfound = true;
}
// main validation function
function Validate() {
   errfound = false;
   if (!ValidLength(document.form.contact_name.value,1))
      error(document.form.contact_name,"Enter Your  Name");
       if (!ValidEmail(document.form.contact_email.value,1))
      error(document.form.contact_email,"Enter Your Email Id");

      if (!ValidLength(document.form.contact_phone.value,1))
      error(document.form.contact_phone,"Invalid phone number");


     if (!ValidLength(document.form.contact_comments.value,1))
      error(document.form.contact_comments,"Enter Your Comments");




      return !errfound; /* true if there are no errors */
}</SCRIPT>
<SCRIPT language="javascript">
function Only_Num(id) {
    if(isNaN(document.getElementById(id).value)) {
        alert("Please Enter Numbers Only (0-9)..");
        document.getElementById(id).select();
        document.getElementById(id).value=""
        document.getElementById(id).focus();
    }
    return;
}
</SCRIPT>
</head>

<body bgcolor="ffffff" class="ServiceContentBody">

<form name="form" action="submit.php"  onSubmit="return Validate()" method="post">
  <table width="391" border="0" cellpadding="0" cellspacing="2">


    <tr>
      <td width="1" align="left" valign="middle" class="ContactFormText"></td>
      <td width="125" align="right" valign="middle" class="ContactFormText"><div align="right">Name:</div></td>
      <td width="257"><input name="contact_name" type="text" size="35"  ></td>
    </tr>

    <tr>
      <td width="1" align="left" valign="middle" class="ContactFormText"></td>
      <td width="125" align="right" valign="middle" class="ContactFormText"><div align="right">E-mail:</div></td>
      <td><input  name="contact_email"type="text" size="35"></td>
    </tr>

    <tr>
      <td width="1" align="left" valign="middle" class="ContactFormText"></td>
      <td width="125" align="right" valign="middle" class="ContactFormText"><div align="right">Phone:</div></td>
      <td><input name="contact_phone"   size="35" onChange="Javascript:LA()"  onKeyUp="Only_Num(this.id)"id="phone"></td>
    </tr>

    <tr>
      <td width="1" align="left" valign="top" class="ContactFormText"></td>
      <td width="125" height="0" align="left" valign="middle" class="ContactFormText"><div align="right">Comments:</div></td>
      <td height="0" align="left" valign="top"><textarea name="contact_comments" cols="40" rows="4" ></textarea></td>
    </tr>

    <tr align="center">
      <td width="1" valign="top" class="ContactFormText"></td>
      <td width="125" height="22" valign="top" class="ContactFormText"></td>
      <td height="22" align="left" valign="middle" class="ContactFormText"><input name="Submit" type="submit" class="WorkSortList" value="SEND">      </td>
    </tr>
  </table>
</form>
</body>
</html>

Edited 3 Years Ago by mike_2000_17: Fixed formatting

This article has been dead for over six months. Start a new discussion instead.