title: Email form success in Javascript But no email is being sent with the form data.
body: <p>The form seems to validate and go to the confirmation url.  Where I am running into a problem is that the form doesn't send the form data to my email.  I am rather weak in JS and hoping some of your experts can help me with this code.  The link to the page in the website is: <a href="http://www.thenaturalcottage.com/ContactUs.html" rel="nofollow">http://www.thenaturalcottage.com/ContactUs.html</a>.</p>
  
  <p>The file for the text/javascript file is <a href="http://www.thenaturalcottage.com/contact.js" rel="nofollow">http://www.thenaturalcottage.com/contact.js</a>
  I kept formatting the code to fit here but the code kept throwing an error.
      
        
          
            <h3>Contact Information</h3>
          <p>Name<em><br />
            </p>
          <p>Address</em><br />
            </p>
          <p>City<em>, State</em>, Zip*<br />
              
              
             </p></p>
  
  <pre><code>    &lt;p&gt;Telephone&lt;span class="red"&gt;*&lt;/span&gt;&lt;/p&gt;
      &lt;p&gt;(&lt;input type="text" name="area" size="3" maxlength="3" onchange="return checkForNumber(this.value);" /&gt;
      &lt;input type="text" name="exchange" size="3" maxlength="3" onchange="return checkForNumber(this.value);" /&gt;
      &lt;input type="text" name="phone" size="4" maxlength="4" onchange="return checkForNumber(this.value);"  /&gt;&lt;/p&gt;
      &lt;p&gt;E-mail address&lt;span class="red"&gt;*&lt;/span&gt;&lt;br /&gt;
      &lt;input type="text" name="email" size="50" value="Enter your email address" onclick="if(this.value=='Enter your email address') this.value='';" / &gt;&lt;/p&gt;
      &lt;p&gt;&lt;strong&gt;How do you perfer us to contact you&lt;/strong&gt;&lt;br /&gt;        
      &lt;input type="radio" name="contact" value="Phone" /&gt;Phone&lt;br /&gt;
      &lt;input type="radio" name="contact" value="email" /&gt;Email &lt;br /&gt;
      &lt;input type="radio" name="contact" value="mail" /&gt;Snail mail
      &lt;/p&gt;
      &lt;p&gt;Which one of our services are you interested in recieving information about?&lt;/p&gt;
  &lt;p&gt;
     &lt;input type="checkbox" name="services" value="classes" /&gt; Classes &lt;br /&gt;
     &lt;input type="checkbox" name="services" value="events" /&gt; Events &lt;br /&gt;
     &lt;input type="checkbox" name="services" value="customfragarance" /&gt; CustomFragrance    &lt;br /&gt;
     &lt;input type="checkbox" name="services" value="suggestions" /&gt; Suggestions&lt;br /&gt;
     &lt;input type="checkbox" name="services" value="other" /&gt; Other
     &lt;/p&gt;
     &lt;h5&gt;Please enter any comments here:&lt;/h5&gt;
     &lt;textarea name="comments" rows="10" cols="40"&gt;
     &lt;/textarea&gt;
  
     &lt;p&gt;&lt;input type="submit" value="Submit" /&gt;&lt;/p&gt;
     &lt;p&gt;&lt;input type="reset" value="Start Over" /&gt;&lt;/p&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Here is the Javascript</p>
  
  <pre><code>function checkForNumber(fieldValue) {
     //validation for phone number
     var numberCheck = isNaN(fieldValue);
     if(numberCheck == true) {  
         window.alert("You must enter a numeric value!");
         }
  }
  
  function confirmSubmit(){
         //confirm submit
         var submitForm = window.confirm("Are you sure you want to submit the form?");
         //check to make sure that none of the text areas are blank
         if (document.forms[0].name.value == "" || document.forms[0].address.value == "" || document.forms[0].city.value == ""
                               || document.forms[0].state.value == "" || document.forms[0].zip.value == ""){
                               window.alert("You must enter your contact information.");
                               return false;
                               }
          //phone validation
          else if (document.forms[0].area.value == "" || document.forms[0].exchange.value == "" || document.forms[0].phone.value == "") {
                               window.alert("You must enter your telephone number.");
                               return false;
                               }
          //email error message
          else if (document.forms[0].email.value == ""){
                               window.alert("You must enter a correct email address");
                               return false;
                               }
         onsubmit="return confirmSubmit();"
  }
  
  function confirmReset(){
         var resetForm = window.confirm("Are you sure you want to reset the form?")
         if (resetForm == true)
         return true;
         return false;                     
         }
  
  function submitForm(){
         if (document.forms[0].firstName.value == "" || document.forms[0].lastName.value == ""){
         window.alert("You must enter your first and last name!");
         return false;
         }
         else 
         return true;       
  }
  
  function contactMe(){
         for(var i=0; i&lt;document.forms[0].delivery.length; ++i)
         {
         if (document.forms[0].delivery[i].checked == true)
         document.forms[0].delivery[i].checked = false;
         }
  }
  </code></pre>