0 Replies Latest reply on Aug 15, 2007 2:26 PM by kiwidesigner

    Please look at form code for me - tried everything :(

    kiwidesigner
      Can someone have a quick look at this code and see if there is a fault. Weird, same code on 2 sites, both work but the second one doesnt send the "parts" info back in the email. Thanks in advance.


      <td width="350"><form action=" http://www.autobuy.co.nz/finance_forms/form_mailer.php" method="post" name="parts_request">
      <input type="hidden" name="email[recipient_name]" value="Capital City Mazda Parts">
      <input type="hidden" name="email[recipient_email]" value="parts@ccpd.co.nz">
      <input type="hidden" name="email[from_name]" value="Parts Enquiry Form">
      <input type="hidden" name="email[from_email]" value="webform@autobuy.co.nz">
      <input type="hidden" name="email[redirect]" value=" http://www.capitalcitymazda.co.nz/thankyou.htm">
      <input type="hidden" name="email[subject]" value="Parts Request">
      <script type="text/javascript">

      e = new Array();
      w = new Array();

      e[0] = 'fields[str_name]';
      w[0] = 'Please enter your name.';
      e[1] = 'fields[str_phone]';
      w[1] = 'Please enter a phone number.';

      email_field = 'fields[str_email]';

      function validate_form(form) {
      // And now do the work
      var length = e.length;
      for ( var i = 0; i < length; i++) {
      // Text
      if (form.elements[e ].value == '') {
      form.elements[e
      ].focus();
      alert(w );
      return false;
      }
      }

      // Check the email address
      if (!validate_email(form.elements[email_field].value)) {
      form.elements[email_field].focus();
      alert('Please enter an email address.');
      return false;
      }

      // We're done here
      return true;
      }

      function validate_email(str) {
      return str.match(/^[\w]{1}[\w\.\-_]*@[\w]{1}[\w\-_\.]*\.[\w]{2,6}$/i)
      }
      </script>
      <table width="383" border="0" cellspacing="1" cellpadding="1">
      <tr valign="top" align="left">
      <td width="30%" nowrap class="willams3"><div align="left">Name</div></td>
      <td width="70%"> <font face="Arial, Helvetica, sans-serif" size="-1">
      <input name="fields[str_name]" type="text" class="form" size="35" maxlength="70">
      </font></td>
      </tr>
      <tr valign="top" align="left">
      <td width="30%" nowrap class="willams3"><div align="left">Email Address </div></td>
      <td width="70%"> <font face="Arial, Helvetica, sans-serif" size="-1">
      <input name="fields[str_email]" type="text" class="form" size="35" maxlength="70">
      </font></td>
      </tr>
      <tr valign="top" align="left">
      <td width="30%" nowrap class="willams3"><div align="left">Phone Number </div></td>
      <td width="70%"> <font face="Arial, Helvetica, sans-serif" size="-1">
      <input name="fields[str_phone]" type="text" class="form" size="35" maxlength="70">
      </font></td>
      </tr>
      <tr valign="top" align="left">
      <td width="30%" nowrap class="willams3"><div align="left">Make of Vehicle</div></td>
      <td width="70%"> <font face="Arial, Helvetica, sans-serif" size="-1">
      <input name="fields[str_car_make]" type="text" class="form" size="35" maxlength="70">
      </font></td>
      </tr>
      <tr valign="top" align="left">
      <td width="30%" nowrap class="willams3"><div align="left">Model</div></td>
      <td width="70%"><font face="Arial, Helvetica, sans-serif" size="-1">
      <input name="fields[str_car_model]" type="text" class="form" size="35" maxlength="70">
      </font></td>
      </tr>
      <tr valign="top" align="left">
      <td width="30%" nowrap class="willams3"><div align="left">Year of Manufacture </div></td>
      <td width="70%"><font face="Arial, Helvetica, sans-serif" size="-1">
      <input name="fields[str_year_of_manufacture]" type="text" class="form" size="35" maxlength="70">
      </font></td>
      </tr>
      <tr valign="top" align="left">
      <td width="30%" nowrap class="willams3"><div align="left">Chassis Number </div></td>
      <td width="70%"><font face="Arial, Helvetica, sans-serif" size="-1">
      <input name="fields[str_chassis_number]" type="text" class="form" size="35" maxlength="70">
      </font></td>
      </tr>
      <tr valign="top" align="left">
      <td width="30%" nowrap class="willams3">
      <p align="left">Parts Required<br>
      (part name and details)</p></td>
      <td width="70%">
      <p><font face="Arial, Helvetica, sans-serif" size="-1">
      <textarea name="textarea" cols="35" rows="6" wrap="VIRTUAL" class="form"></textarea>
      </font></p>
      <p align="left"> <font face="Arial, Helvetica, sans-serif" size="-1">
      <input name="Send2" type="submit" class="form3" onClick=" return validate_form(document.forms.parts_request);" value="Send">
      </font></p></td>
      </tr>
      </table>
      <br>
      </form>