[Javascript] "is not defined" error
Peter Brunone
peter at brunone.com
Thu Aug 1 11:24:15 CDT 2002
Have you tried document.temp.submit() ?
----- Original Message -----
From: "BRUCE" <bruce at astound.net>
| Hi, I am looking for a little help with a javascript error i am getting on
a
| form.
| What I am trying to do is check to see if a form field is correctly filled
| in.
| If the field has 0 or 8 characters it is ok, and the form should be
| submitted to the cgi.
| If it has between 1-7 characters it gets the alert message,
| At the moment the alert works, but if the field has 0 or 8 characters I
get
| a javascript error : "temp is not defned" and the line number referes to
the
| "
| temp.submit()" line
|
| Below is the coding snippets
|
| In the HEAD sectin I have the following:
|
| <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>
|
| In the BODY I have a form:
| <form method="post"
| action="https://w1305.securedweb.net/~redhot/cgi-bin/bnbform.cgi"
| name="temp">
|
| the FIELD is set up as:
| <input type="text" name="astd" maxlength="8">
|
| and at the SUBMIT button I have the following:
| <input type="button" name="submit" value="submit"
| onClick="javascript:checkChars()">
|
| Any input would be greatly appreciated,
| Thanks,
| Bruce
|
More information about the Javascript
mailing list