Re: JavaScript Forms and AOL

by "Paul Roberts" <roberts_paul(at)bigfoot.com>

 Date:  Sat, 12 Feb 2000 11:09:00 -0000
 To:  <hwg-languages(at)mail.hwg.org>,
"Carola Otto" <cotto(at)buehler.ffm.de>
 References:  0
  todo: View Thread, Original
action="mailto:winter(at)buehler.ffm.de?subject=Brochure

Mailto forms just do not work in all browsers esp. IE which AOL is under the
hood.

You really need a CGI script for this sort of thing.


Paul Roberts

roberts_paul(at)bigfoot.com
================================
Paul Roberts  <roberts_paul(at)bigfoot.com>
  Web Design : CGI Scripts : e-Commerce
  Web Graphics : Databases : e-Marketing
================================


----- Original Message -----
From: Carola Otto <cotto(at)buehler.ffm.de>
To: <hwg-languages(at)mail.hwg.org>
Sent: 10 February 2000 13:26
Subject: JavaScript Forms and AOL


Dear all,

i really need your help. Sorry for my terrible spelling.
I have a Form were I check with JavaScript if the nessecary fields are
filled out.
This happens on submit. If everything is ok the form will be submitted
to 2 email adresses.
So far its ok but AOL only deliveres empty emails with something like
Brochure%20Request%20-%20
in the subject line. Could somebody tell me what i did wrong? Thanks for
your help.

Carola

-------- Here comes the Cody sorry its quite large ------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Cadillac Europe - Brochure Request</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=">
<script LANGUAGE="JavaScript">

<!-- Comment out for Browsers that do not support the <script> tag.

   // display the European Data Protection Directive in new window.
   function brochure_display_window(url) {
      window.open(url, "cad_data_legal",
"width=550,height=235,scrollbars=yes,resizable=no,screenX=250,screenY=250");
   }

   function isblank(str) {
      for(var inx=0; inx<str.length; inx++) {
         var dummy = str.charAt(inx);
         if ((dummy != " ") && (dummy != '\n') && (dummy != '\t')) {
            return false;
         }
      }
      return true;
   }

   function formrecord(formelement, description) {
      this.formelement = formelement;
      this.description = description;
   }
// -->
</script>
<script LANGUAGE="JavaScript">

<!-- Comment out for Browsers that do not support the <script> tag.
function checkform() {
   if (!(document.brochureform.seville.checked)) {
      document.brochureform.seville.focus();
      var str = "______________________________________\n\n";
      str += "W�hlen Sie mindestens ein Modell, f�r das Sie einen
Katalog haben m�chten.\n";
      str += "______________________________________\n";
      window.alert(str);
      return false;
   }
   var flag = false;
   for (var inx=0; inx<document.brochureform.lang.length; inx++) {
      if (document.brochureform.lang[inx].checked == true) {
      flag = true;
      break;
      }
   }
   if (flag == false) {
      document.brochureform.lang[0].focus();
      var str = "_____________________________\n\n";
      str += "W�hlen Sie eine Sprache f�r den Katalog Ihrer Wahl.\n";
      str += "_____________________________\n";
      window.alert(str);
      return false;
   }
   var blankfields = "";
   var element = new Array();
   element[0] = new formrecord(document.brochureform.firstname,
"Vorname:");
   element[1] = new formrecord(document.brochureform.lastname,
"Familienname:");
   element[2] = new formrecord(document.brochureform.streetaddr,
"Stra�e, Nr.:");
   element[3] = new formrecord(document.brochureform.postalcode,
"PLZ:");
   element[4] = new formrecord(document.brochureform.city, "Stadt:");
   element[5] = new formrecord(document.brochureform.cntry, "Land:");
   element[6] = new formrecord(document.brochureform.email, "E-mail:");
   flag = true;
   for (var inx=0; inx<element.length; inx++) {
      if ((element[inx].formelement.value == null) ||
(element[inx].formelement.value == "") ||
isblank(element[inx].formelement.value)) {
         if (flag) {
            var index = inx;
            flag = false;
         }
         blankfields += "\n          " + element[inx].description;
      }
   }
   if (!blankfields) {
      return true;
   }
   element[index].formelement.focus();
   var str = "________________________________________________\n\n";
   str += "Ihre Anfrage wurde nicht �bertragen.\n";
   str += "Bitte f�llen Sie folgenden Felder aus und �bertragen Sie noch
einmal.\n";
   str += "________________________________________________\n";
   str += blankfields + "\n";
   window.alert(str);
   return false;
}
// -->

</script>
</HEAD>
<BODY BGCOLOR="#999999" marginheight="0" marginwidth="0" leftmargin="0"
topmargin="0">
<table width="776" border="0" cellspacing="0" cellpadding="0" vspace="0"
hspace="0">
  <tr>
    <td valign="top" rowspan="2" bgcolor="#999999"><img
src="../images/empty.gif" width="145" height="10"></td>
    <td height="25" colspan="2" bgcolor="#F7EEC6">
      <blockquote>
        <p><img src="images/title/t_brochures_de.gif" width="109"
height="29"
vspace="20" alt="Broschures"><br>
          <font face="Verdana, Arial, Helvetica, sans-serif" size="2">
<b>Um
einen
          Katalog zu erhalten geben Sie bitte die folgenden
Informationen ein.
          </b><br>
          <font size="1">Das Ausf&uuml;llen von Feldern, die mit einem *
gekennzeichnet
          sind, ist freiwillig.</font></font></p>
      </blockquote>
      </td>
  </tr>
  <tr>
    <td colspan="2" bgcolor="#F7EEC6" height="100%"><font face="Verdana,
Arial, Helvetica, sans-serif" size="2">
      </font>
          <form action="mailto:winter(at)buehler.ffm.de?subject=Brochure
Request -
Cadillac&cc=winter(at)buehler.ffm.de" method="post" enctype="text/plain"
name="brochureform" onSubmit="return checkform();">
        <br>
        <table border="0" cellspacing="5" cellpadding="0" name="land">
          <tr>
            <td width="50"><img src="../images/empty.gif" width="50"
height="5"></td>
            <td colspan="2"><font face="Verdana, Arial, Helvetica,
sans-serif"
size="2">Bevorzugte
              Sprache</font></td>
            <td><font face="Verdana, Arial, Helvetica, sans-serif"
size="2">Modelle</font></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td><font face="Verdana, Arial, Helvetica, sans-serif"
size="2">
              <input type="checkbox" name="lang" value="English">
              Englisch<br>
              <input type="checkbox" name="lang" value="German">
              Deutsch <br>
              <input type="checkbox" name="lang" value="Dutch">
              Fl&auml;misch </font></td>
            <td><font face="Verdana, Arial, Helvetica, sans-serif"
size="2">
              <input type="checkbox" name="lang" value="French">
              Franz&ouml;sisch<br>
              <input type="checkbox" name="lang" value="Italian">
              Italienisch<br>
              <input type="checkbox" name="lang" value="Spanish">
              Spanisch </font></td>
            <td valign="top"><font face="Verdana, Arial, Helvetica,
sans-serif"
size="2">
              <input type="checkbox" name="seville" checked value="1">
              Seville<br>
              <br>
              </font></td>
          </tr>
        </table>
        <table border="0" cellspacing="5" cellpadding="0"
name="adresse">
          <tr>
            <td width="50">&nbsp;</td>
            <td colspan="2"><font face="Verdana, Arial, Helvetica,
sans-serif"
size="2">Title:
              <select name="titlecode" size="1" align="left">
                <option selected>&nbsp; &nbsp; &nbsp; </option>
                <option>Herr</option>
                <option>Frau</option>
                <option>Dr.</option>
                <option>Prof.</option>
              </select>
              </font></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td colspan="2"><font face="Verdana, Arial, Helvetica,
sans-serif"
size="2">Vorname:<br>
              <input type="text" name="firstname" size="15">
              </font></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td colspan="2"><font face="Verdana, Arial, Helvetica,
sans-serif"
size="2">Familienname:<br>
              <input type="text" name="lastname" size="22">
              </font></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td colspan="2"><font face="Verdana, Arial, Helvetica,
sans-serif"
size="2">Stra&szlig;e,
              Nr.:<br>
              <input type="text" name="streetaddr" size="22">
              </font></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td><font face="Verdana, Arial, Helvetica, sans-serif"
size="2">
PLZ:<br>
              <input type="text" name="postalcode" size="8"
maxlength="8">
              </font></td>
            <td><font face="Verdana, Arial, Helvetica, sans-serif"
size="2">Stadt:<br>
              <input type="text" name="city" size="22" maxlength="25">
              </font></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td colspan="2"><font face="Verdana, Arial, Helvetica,
sans-serif"
size="2">Land:<br>
              <input type="text" name="cntry" size="15" maxlength="35">
              </font></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td colspan="2"><font face="Verdana, Arial, Helvetica,
sans-serif"
size="2">E-Mail:<br>
              <input type="text" name="email" size="15" value="@"
maxlength="60">
              </font></td>
          </tr>
        </table>
        <table border="0" cellspacing="5" cellpadding="0" name="info">
          <tr>
            <td width="50"><img src="../images/empty.gif" width="50"
height="5"></td>
            <td><font face="Verdana, Arial, Helvetica, sans-serif"
size="2">*
              Telefon: <br>
              <input type="text" name="phone" size="15" maxlength="17">
              </font></td>
            <td><font face="Verdana, Arial, Helvetica, sans-serif"
size="2">*
              Telefax:<br>
              <input type="text" name="fax" size="15" maxlength="17">
              </font></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td colspan="2"><font face="Verdana, Arial, Helvetica,
sans-serif"
size="2">*
              Alter:
              <input type="text" name="age" size="2" maxlength="3">
              </font></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td colspan="2"><font face="Verdana, Arial, Helvetica,
sans-serif"
size="2">*
              Beruf:</font></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td><font face="Verdana, Arial, Helvetica, sans-serif"
size="2">
              <input type="checkbox" name="occupation" value="Employee">
              Angestellt<br>
              <input type="checkbox" name="occupation" value="Retired">
              Rentner </font></td>
            <td><font face="Verdana, Arial, Helvetica, sans-serif"
size="2">
              <input type="checkbox" name="occupation"
value="Self_Employed">
              Selbstst&auml;ndig <br>
              <input type="checkbox" name="occupation" value="Other">
              Andere</font></td>
          </tr>
        </table>
        <table border="0" cellspacing="5" cellpadding="0" name="cars">
          <tr>
            <td width="50"><img src="../images/empty.gif" width="50"
height="5"></td>
            <td colspan="2"><font size="2" face="Verdana, Arial,
Helvetica,
sans-serif">*Mein
              gegenw&auml;rtiges Fahrzeug ist ein. </font></td>
          </tr>
          <tr>
            <td width="56">&nbsp;</td>
            <td width="220"><font face="Verdana, Arial, Helvetica,
sans-serif"
size="2">Marke:
              &nbsp;
              <input type="text" name="brand1" size="15" maxlength="20">
              </font></td>
            <td width="220"><font face="Verdana, Arial, Helvetica,
sans-serif"
size="2">Marke:
              &nbsp;
              <input type="text" name="brand2" size="15">
              </font></td>
          </tr>
          <tr>
            <td width="56">&nbsp;</td>
            <td width="220"><font face="Verdana, Arial, Helvetica,
sans-serif"
size="2">Modell:
              &nbsp;
              <input type="text" name="model1" size="15" maxlength="20">
              </font></td>
            <td width="220"><font face="Verdana, Arial, Helvetica,
sans-serif"
size="2">Modell:
              &nbsp;
              <input type="text" name="model2" size="15" maxlength="20">
              </font></td>
          </tr>
          <tr>
            <td width="56">&nbsp;</td>
            <td width="220">
              <p><font face="Verdana, Arial, Helvetica, sans-serif"
size="2">
                Baujahr:
                <input type="text" name="modelyear1" size="4"
maxlength="4">
                </font></p>
            </td>
            <td width="220">
              <p><font face="Verdana, Arial, Helvetica, sans-serif"
size="2">
                Baujahr:
                <input type="text" name="modelyear2;" size="4"
maxlength="4">
                </font></p>
            </td>
          </tr>
          <tr>
            <td width="56">&nbsp;</td>
            <td colspan="2"><font face="Verdana, Arial, Helvetica,
sans-serif"
size="2">*
              Wann planen Sie die Anschaffung eines neuen
Fahrzeugs?</font></td>
          </tr>
          <tr>
            <td width="56">&nbsp;</td>
            <td colspan="2"> <font face="Verdana, Arial, Helvetica,
sans-serif"
size="2">
              <input type="checkbox" name="nextvehicle" value="6">
              &nbsp;&nbsp;6 Monate<br>
              <input type="checkbox" name="nextvehicle" value="12">
              12 Monate<br>
              <input type="checkbox" name="nextvehicle" value="18">
              18 Monate oder sp&auml;ter</font></td>
          </tr>
          <tr>
            <td width="56">&nbsp;</td>
            <td colspan="2"><font face="Verdana, Arial, Helvetica,
sans-serif"
size="2">Ich
              stimme den <a
href="javascript:brochure_display_window('data_prot_de.htm')">Datenschutzbes
timmungen
              zu:</a>
              <input type="checkbox" checked  name="datadirective"
value="Yes">
              </font></td>
          </tr>
          <tr>
            <td width="56">&nbsp;</td>
            <td align="center" width="163">&nbsp;</td>
            <td align="center" width="121">&nbsp;</td>
          </tr>
          <tr>
            <td width="56">&nbsp;</td>
            <td align="center" width="163"><font face="Verdana, Arial,
Helvetica, sans-serif" size="2">
              <input type="submit" name="submit"
value="&Uuml;bertragen">
              </font></td>
            <td align="center" width="121"><font face="Verdana, Arial,
Helvetica, sans-serif" size="2">
              <input type="reset" name="reset" value="Abbrechen">
              </font></td>
          </tr>
        </table>
        <br>
      </form>
      </td>
  </tr>
</table>
</BODY>
</HTML>

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA