Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jul 2003
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Quickie - Error message I don't understand

    The following code:

    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??

    TIA

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #3
    New Coder
    Join Date
    Jul 2003
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    just saw that I've embarassed myself nicely with this one... lol! Of course it's messaging that out - I told it to! 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?
    Last edited by Cringer; 10-14-2003 at 04:50 PM.

  • #4
    New Coder
    Join Date
    Jul 2003
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry

    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •