[thelist] Javascript Code broke?
Tom Dell'Aringa
pixelmech at yahoo.com
Thu May 20 10:41:52 CDT 2004
--- Rob Smith <rob.smith at THERMON.com> wrote:
> Hi.
>
> For the life of me I cannot figure out why this broke. (see arrow)
>
> function validate() {
> if (AddProject.ProjectName.value == "") {
> alert("You must enter a Project Name.");
> return false;
> }
> else
> {
> document.AddProject.submit(); <------------------
> return true;
> }
> }
Because you are not defining your variables. The script doesn't know
what AddProject or ProjectName are - they are undefined. (If you use
FireFox/Mozilla javascript console, you would see that)
var AddProject = document.forms['AddProject'];
and whatever the other thing is, define that.
HTH
Tom
=====
http://www.Pixelmech.com/ - read my latest blog posting!
http://www.crossandthrone.com/ - Eternal Life
John 3:16
More information about the thelist
mailing list