[Javascript] "is not defined" error

Peter Brunone peter at brunone.com
Thu Aug 1 16:17:01 CDT 2002


    I'd suggest being a bit more explicit about your conditional blocks,
i.e.

 <SCRIPT>
   function checkChars()
 {
    if (document.temp.astd.value.length < 8 &&
document.temp.astd.value.length > 0)
    {
     alert("Please contact ASTD for your correct ID number");
    }
    else
    {
     document.temp.submit();
    }
 }
    </SCRIPT>

    (I assume you meant document.temp.submit() on that last line)

    The only other thing I can think to recommend is that you rename your
form to something else, like tempForm.  It's possible that (a) temp is some
sort of reserved word in the scripting engine, or (b) temp is the name of
some other element... of course if either of these were true, you'd think
none of this would work, but with the information we have, I don't know what
else to tell you.

    Any chance your case is messed up in that last statement?  IE may
forgive, but Netscape will force you to get it right.  Again, just a
thought...

-Peter

----- Original Message -----
From: "BRUCE" <bruce at astound.net>


| Ok, so I did that (document.temp.submit(), and the error is still
appearing.
| is it possibly that I have the code in the wrong spot? It is currently in
| the <head>
| As I mentioned eariler, the first part of the equation (if...) works
|
| I have tried a variety of different incarnations, and it just won't go.
| Am I nuts? I m feeling that way...
| :-)
|
| CODE:
|
|  <SCRIPT>
|    function checkChars()
|  {
|     if (document.temp.astd.value.length < 8 &&
|  document.temp.astd.value.length > 0)
|      alert("Please contact ASTD for your correct ID number");
|     else
|      temp.submit()
|  }
|     </SCRIPT>
|




More information about the Javascript mailing list