gary: mehrere Form-Befehle ?

Beitrag lesen

Hi nochmal,

Hier mein cgi testprog, es ist viel kleiner als die Internetseite:

<html>
<head>
<title>Formulareingaben</title>
<script type="text/javascript">
function chkFormular () {
  if (document.Formular.Anrede.value == "") {
    alert("Bitte Ihre Anrede eingeben!");
    document.Formular.Anrede.focus();
    return false;
  }
  if (document.Formular.Vorname.value == "") {
    alert("Bitte Ihren Vornamen eingeben!");
    document.Formular.Vorname.focus();
    return false;
  }
  if (document.Formular.Nachname.value == "") {
    alert("Bitte Ihren Nachnamen eingeben!");
    document.Formular.Nachname.focus();
    return false;
  }
  if (document.Formular.Geburtsdatum.value == "") {
    alert("Bitte Ihr Geburtsdatum eingeben!");
    document.Formular.Geburtsdatum.focus();
    return false;
  }
  if (document.Formular.Geburtsdatum.value.indexOf(".") == -1) {
    alert("Kein Geburtsdatum TT.MM.JJJJ");
    document.Formular.Geburtsdatum.focus();
    return false;
  }
  if (document.Formular.Strasse.value == "") {
    alert("Bitte Strasse eingeben!");
    document.Formular.Strasse.focus();
    return false;
  }
  if (document.Formular.Platz.value == "") {
    alert("Bitte PLZ eingeben!");
    document.Formular.Platz.focus();
    return false;
  }
 var chkZ = 1;
  for (i = 0; i < document.Formular.Platz.value.length; ++i)
    if (document.Formular.Platz.value.charAt(i) < "0" ||
        document.Formular.Platz.value.charAt(i) > "9")
      chkZ = -1;
  if (chkZ == -1) {
    alert("Platz erlaubt nur Zahlen!");
    document.Formular.Platz.focus();
    return false;
  }

if (document.Formular.Ort.value == "") {
    alert("Bitte Ort eingeben!");
    document.Formular.Ort.focus();
    return false;
  }
  if (document.Formular.Land.value == "") {
    alert("Bitte Land eingeben!");
    document.Formular.Land.focus();
    return false;
  }
  if (document.Formular.Mail.value == "") {
    alert("Bitte Ihre E-Mail-Adresse eingeben!");
    document.Formular.Mail.focus();
    return false;
  }
  if (document.Formular.Mail.value.indexOf("@") == -1) {
    alert("Keine gültige E-Mail-Adresse!");
    document.Formular.Mail.focus();
    return false;
  }
  CheckD00() {
    for (i = 0; i < document.Box00.D00.length; ++i)
    if (document.Box00.D00.options[i].selected == true)
   document.Formular.artikel.value = document.Box00.D00.options[i].value;
 }
}
</script>
</head>
<body>

<form name="Box00" action="">
        <p align="center"></p>
       <select name="D00" size="1" onchange="CheckD00()">
          <option value="0" selected>x 0</option>
          <option value="1">x 1</option>
          <option value="2">x 2</option>
          <option value="3">x 3</option>
          <option value="4">x 4</option>
          <option value="5">x 5</option>
       </select>
</form>

<h1>Formular</h1>

<form name="Formular" action="http://www.beispiel.com/cgi-bin/Beispiel.pl"
  method="post" onsubmit="return chkFormular()">

<pre>
<input type="hidden" name="recipient" value="beispiel@beispiel.com">
<input type="hidden" name="redirect" value="http://www.beispiel.com/order_answer_ch.htm">
Anrede:  <input type="text" size="40" maxlength="40" name="Anrede">
Vorname: <input type="text" size="40" maxlength="40" name="Vorname">
Nachname: <input type="text" size="40" maxlength="40" name="Nachname">
Geburtsdatum: <input type="text" size="40" maxlength="10" name="Geburtsdatum">
Strasse/Nr.: <input type="text" size="40" maxlength="40" name="Strasse">
Platz:  <input type="text" size="40" maxlength="10" name="Platz">
Ort:  <input type="text" size="40" maxlength="40" name="Ort">
Land:  <input type="text" size="40" maxlength="40" name="Land">
E-Mail:  <input type="text" size="40" maxlength="40" name="Mail">
<input type="hidden" name="artikel">

Formular: <input type="submit" value="Absenden"><input type="reset" value="Abbrechen">

</pre>
</form>

</body>
</html>

Da ahnst es wen ich hier Code reinstelle: Es geht leider trotz Anpassung immer noch. In de E-Mail sind alle Adressdaten drin, nur den Wert des Rollfeldes will er einfach nicht in der Mail anzeigen.

gruss gary.