Web Analytics Made Easy -
StatCounter emailing forms - CodingForum

Announcement

Collapse
No announcement yet.

emailing forms

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • emailing forms

    I have a form that I'm trying to email but it doesn't work.

    <form name="form1" method="post" action="mailto:[email protected]" enctype="text/plain">

    This is the code I'm using. Can someone tell me what I'm doing wrong? I get the email but it doesn't have anything in it.

  • #2
    What's the rest of the form look like?

    Comment


    • #3
      form

      do you want the url or the code? Oh well, I'll give you both.



      <html>
      <head>
      <title>Comments</title>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
      <script language="JavaScript">
      <!--
      function MM_reloadPage(init) { //reloads the window if Nav4 resized
      if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
      document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
      else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
      }
      MM_reloadPage(true);
      // -->
      </script>
      </head>

      <body bgcolor="#CCFFCC" text="#666600" link="#009900" alink="#00FF00" vlink="#006600">
      <div align="left">
      <table width="75%" border="0" height="567">
      <tr bgcolor="#000000">
      <td colspan="2" height="125">
      <div align="center">
      <p><b><font face="Arial, Helvetica, sans-serif" size="7" color="#00FF00"><i>Scallions</i></font></b></p>
      <p align="center"><b><i><font face="Arial, Helvetica, sans-serif" size="5" color="#00FF00">Tell
      us how we're doing..</font></i></b></p>
      </div>
      </td>
      </tr>
      <tr>
      <td height="518" width="15%" bgcolor="#000000"><img src="../Photos/GreenOnions.jpg" width="120" height="412" align="top"></td>
      <td height="518" valign="top">
      <form name="form1" method="post" action="mailto:[email protected]" enctype="text/plain">
      <p><font face="Arial, Helvetica, sans-serif" color="#000000"><b>How
      often do you visit Scallions?
      <select name="often">
      <option>Very often</option>
      <option>Often</option>
      <option>Seldom</option>
      </select>
      </b></font></p>
      <p><b><font face="Arial, Helvetica, sans-serif" color="#000000">How
      would you rate the food at your last visit?
      <select name="ratefood">
      <option>Excellent</option>
      <option>Good</option>
      <option>Poor</option>
      </select>
      </font></b></p>
      <p><b><font face="Arial, Helvetica, sans-serif" color="#000000">How
      would you rate the service at your last visit?
      <select name="rateservice">
      <option>Excellent</option>
      <option>Good</option>
      <option>Poor</option>
      </select>
      </font></b></p>
      <p><b><font face="Arial, Helvetica, sans-serif" color="#000000">What
      did you order at your last visit?
      <input type="text" name="lastorder">
      </font></b></p>
      <p><b><font face="Arial, Helvetica, sans-serif" color="#000000">What
      is your favorite menu item?
      <input type="text" name="favorite">
      </font></b></p>
      <p><b><font face="Arial, Helvetica, sans-serif" color="#000000">Additional
      comments and/or suggestions:</font></b></p>
      <p> <b><font face="Arial, Helvetica, sans-serif" color="#000000">
      <textarea name="comments" cols="70" rows="10"></textarea>
      </font></b> </p>
      <p><font face="Arial, Helvetica, sans-serif" color="#000000"><b>Thank
      you for completing the comment form. You are important to us.</b></font></p>
      <p>
      <input type="submit" name="Submit" value="Submit">
      <input type="reset" name="Submit2" value="Reset">
      </p>
      </form>
      </td>
      </tr>
      </table>
      </div>
      </body>
      </html>

      Thank you.

      Comment


      • #4
        You have to give a value to each option.

        <option value="Excellent">Excellent</option>
        <option value="Good">Good</option>

        etc

        Comment


        • #5
          A long one but I think it'll help you

          Hi. The form needs formatting a bit more. Field options to be added and some form of validation to ensure that the form is completed properly. Does your web host support asp or cgi? The reason I ask is the form needs to be mailed but currently it will not. It needs the assistance of a server side script. Any way, on with the show.

          The new form code

          <form method="POST" action="path/to/mailer.asp" name="frmformname"> <p><font face="Arial, Helvetica, sans-serif" color="#000000"><b>How often do you visit
          Scallions? <select name="often" size="1">
          <option value="Select">Select</option>
          <option>Very often</option>
          <option>Often</option>
          <option>Seldom</option>
          </select> </b></font></p>
          <p><b><font face="Arial, Helvetica, sans-serif" color="#000000">How would you rate the
          food at your last visit? <select name="ratefood" size="1">
          <option value="Select">Select</option>
          <option>Excellent</option>
          <option>Good</option>
          <option>Poor</option>
          </select> </font></b></p>
          <p><b><font face="Arial, Helvetica, sans-serif" color="#000000">How would you rate the
          service at your last visit? <select name="rateservice" size="1">
          <option value="Select">Select</option>
          <option>Excellent</option>
          <option>Good</option>
          <option>Poor</option>
          </select> </font></b></p>
          <p><b><font face="Arial, Helvetica, sans-serif" color="#000000">What did you order at your
          last visit? <input type="text" name="lastorder" size="20"> </font></b></p>
          <p><b><font face="Arial, Helvetica, sans-serif" color="#000000">What is your favorite menu
          item? <input type="text" name="favorite" size="20"> </font></b></p>
          <p><b><font face="Arial, Helvetica, sans-serif" color="#000000">Additional comments and/or
          suggestions:</font></b></p>
          <p><b><font face="Arial, Helvetica, sans-serif" color="#000000"><textarea name="comments"
          cols="70" rows="10"></textarea> </font></b></p>
          <p><font face="Arial, Helvetica, sans-serif" color="#000000"><b>Thank you for completing
          the comment form. You are important to us.</b></font></p>
          <p><input type="submit" name="Submit" value="Submit"> <input type="reset" name="Submit2"
          value="Reset"> </p>
          </form>

          Submit and clear buttons:

          <input type="button" value="Send Details"
          name="B1" class="NormalButton" onClick="SubmitForm()"> <input type="reset"
          value="Clear Form" name="B2" class="NormalButton">

          An example of a validation script for this form would be:

          <script language="JavaScript">
          function SubmitForm() {
          var blnProblem = false;
          var ptrForm = document.frmformname;
          if(ptrForm.often.value == "Select"){
          alert("Please state how often you visit scallions!");
          ptrForm.often.focus();
          return (false);
          }else if(ptrForm.ratefood.value == "Select"){
          alert("Please rate the food!");
          ptrForm.ratefood.focus();
          return (false);
          }else if(ptrForm.rateservice.value == "Select"){
          alert("Please rate the service!");
          ptrForm.rateservice.focus();
          return (false);
          }else if(ptrForm.lastorder.value == ""){
          alert("Please state what you last ordered!");
          ptrForm.lastorder.focus();
          return (false);
          }else if(ptrForm.favorite.value == ""){
          alert("Please state you favourite food!");
          ptrForm.favourite.focus();
          return (false);
          }
          if(blnProblem == false) {
          ptrForm.submit();
          }
          }
          </script>

          It lives in above the </head> tag.

          Note, it still won't work 100% unless your web host supports asp and if so a script called mailer or something else perhaps will need to be uploaded and pointed to. This will need to be coded for you. If not, the form tag will need modification to point to a cgi script perhaps if they are supported? If not, there are free ones on the web you can point the form tag to but you will not see the senders email address perhaps.

          Here is some code that uses such a free cgi script:

          <html>

          <head>
          <title>New Page 1</title>
          </head>

          <body>

          <form method="post" action="http://www.activeisp.com/scripts/sendformmail.dll">
          <input type="hidden" name="mail-to" value="[email protected]"><input
          type="hidden" name="mail-subject" value="feedback form"><input type="hidden"
          name="mail-success" value="http://fullpath/feedback/thankyou.htm"><p><b>Type of
          feedback...</b></p>
          <p><input type="radio" name="radiobutton" checked value="general"> comment or question <input
          type="radio" name="radiobutton" value="link"> broken link <input type="radio"
          name="radiobutton" value="problem"> other </p>
          <p><b>Please enter your comments... </b></p>
          <p><textarea name="comments" cols="40" rows="1"></textarea> *</p>
          <p><b>Please enter your details...</b></p>
          <p><input type=" text" name="name" size="25"> Name *<br>
          <input type=" text" name="mail-from" size="25"> Email *<br>
          <input type=" text" name="phone" size="25"> Tel</p>
          <p><b>Please select you preferred method of contact...</b></p>
          <p><select name="contact" size="1">
          <option>email</option>
          <option selected>phone</option>
          <option>don't contact me</option>
          </select> </p>
          <div align="left"><p><input type="submit" name="Submit" value="Send"> </p>
          </div>
          </form>
          </body>
          </html>

          Be sure to replace my email address example with your email address and create a thank you page and recode the tag to point to it
          Therapy is expensive, popping bubble wrap is cheap, you choose.

          Comment

          Working...
          X