Mssmar: function checkForm does not always return a value

Beitrag lesen

Hallo,

bei der filgenden Funktino erhalte ich über FFOX die folgende Warnung:
"function checkForm does not always return a value"

Das ist zwar kein Fahler, aber es wäre gut wenn man eine Idee hätte, wie ich es unterdrücken bzw. vermeiden könnte.

Würde das mit einer Catch/Try gehen.

Vielen Dank und Gruß
Messmar

  
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">  
<html>  
<head>  
 <title>Untitled</title>  
</head>  
  
<body>  
  
 <script>  
  statments = '{'+  
    'var oTextNode = document.createTextNode(text);'+  
    'document.getElementById("errorTxt").replaceChild(oTextNode, document.getElementById("errorTxt").firstChild);'+  
    'document.getElementById("errorTxt").className = "errorVisible";'+  
    'return false;'+  
    '}';  
  errorMessage = new Function('text', statments);  
  
  function checkForm(){  
   var manFrau = document.abo.tlt.options[document.abo.tlt.selectedIndex].value;  
   var firstName = document.abo.fnm.value;  
   var lastName = document.abo.lnm.value;  
   var email = document.abo.uemail.value;  
  
   if (!manFrau){  
    errorMessage("Bitte geben Sie Ihren Title an!");  
    return false;  
   }  
   if (!firstName){  
    errorMessage("Bitte geben Sie Ihren Vornamen an!");  
    return false;  
   }  
   if (!lastName){  
    errorMessage("Bitte geben Sie Ihren Nachnamen an!");  
    return false;  
   }  
   if (!email || email.indexOf('@') == -1){  
    errorMessage("Bitte geben Sie Ihre richtige eMail-Adresse an!");  
    return false;  
   }  
   window.location.href='welcome.jsp';  
  }  
 </script>  
  
 <form name="abo" method="post" action="email_do.jsp" onsubmit="return checkForm()">  
  <input type="hidden" name="uuu" value="iii" />  
  <h2>  
   Bitte kontaktieren Sie uns &uuml;ber unser Formular mit Fragen und Anregungen rund um unseren Service auf  
   <a href="#">Link</a>  
  </h2>  
  <fieldset id="daten">  
   <label>Ihr Titel:</label>  
   <select style="width:207px;" name="tlt">  
    <option value="">&nbsp;</option>  
    <option value="1">Herr</option>  
    <option value="2">Frau</option>  
   </select>  
   <br />  
   <label>Ihr Vorname:</label><input type="text" name="fnm" value="" />  
   <label>Ihr Nachname:</label><input type="text" name="lnm" value="" />  
   <label>Ihre eMail Adresse:</label><input type="text" name="uemail" value="" />  
   <label for="hinweis">  
  
    <strong>Hinweis:</strong><br>  
    Proin sed velit eget nunc consectetuer tristique. Donec nunc mi, euismod quis,  
    condimentum non, egestas a, felis. Nulla enim dui, commodo sit amet, iaculis a,  
    placerat sit amet, diam.  
  
   </label>  
   <br />  
  </fieldset>  
  <fieldset id="nachricht">  
   <label for="betreff"><strong>Betreff:</strong></label><br />  
   <input type="text" id="betreff" name="betreff" value="Ihre Anfrage" style="margin-bottom:15px;" />  
  
   <label for="nachricht"><strong>Nachricht:</strong></label><br />  
   <textarea name="comment" id="nachricht" rows="10">Hallo, gerade war ich auf xxxxx und dachte mir, dass die Seite auch für Dich interessant sein könnte. Du kannst dort angeben welches Auto Du planst zu kaufen und auch gleichzeitig einen Termin zur Probefahrt beantragen. Einfach hier klicken xxxx Viele Gr&uuml;&szlig;e!</textarea>  
   <br />  
   <input type="submit" name="submit" class="submitbtn" value="Eintrag absenden" />  
   <input type="reset" name="reset" class="submitbtn" value="Eintrag löschen" style="margin-left:20px;" />  
  </fieldset>  
  <div class="clear"></div>  
 </form>  
  
  
</body>  
</html>