View Full Version : Quickie - Error message I don't understand

10-14-2003, 04:22 PM
The following code:

var NOC;
var template = "9999-XXX-99999AA";
var equal = true;
NOC = document.BrowseForm.NOC;
alert("NOC " + NOC.length + " temp " + template.length);

gives the error message

"NOC undefined temp 16".

Anyone got a clue why on earth this is happening??


Roy Sinclair
10-14-2003, 04:25 PM
Either document.BrowseForm.NOC doesn't exist or it's not an object which has a length property so NOC.length is an undefined field which is why you see undefined displayed as it's value.

10-14-2003, 04:47 PM
:o :o just saw that I've embarassed myself nicely with this one... lol! Of course it's messaging that out - I told it to! :o :o Oh well!!

I've got the BrowseForm there no probs at all...

Although come to think of it the javascript is in the <HEAD> part of the code and of course the form is in the <BODY>. Is this a problem?

10-14-2003, 04:56 PM
Got it now... Grrr....

NOC is a textbox in the form. So it's NOC.value.length Grrr....

Must get on a JavaScript course ASAP...

Thanks for helping a clueless individual, Roy ;)