#1
  1. Webmaster Extraordinaire
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Location
    Woburn, MA
    Posts
    126
    Rep Power
    15

    Problem with NS and Javascript


    Alright, I'm sure this is a simple answer, but since I can't figure it out, I'm hoping someone else can. I'm writing a script to make sure that certain parts of this form have been filled out. The important part of my code is the following:

    if (document.forms.date.begday.value != 'dd')
    {
    /* do nothing */
    }
    else
    {
    error = error + "- Please choose a beginning day.\n";
    verdict = "false";
    }


    I believe that my reference to the element "begday" in the form "date" is not working correctly. It's fine in IE (of course), but will not work in NS. Thanks for all help.
    Craig Anderson
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2001
    Location
    Dublin
    Posts
    413
    Rep Power
    14
    You could try alert()ing the object, building up one step at a time and see what kind of results you get:

    alert (document.forms.date);
    alert (document.forms.date.begday);

    etc..

    also: correct syntax is document.forms.date.elements.begday.value - that might solve your problem.

    Also sometimes helpful to try alerting or document.writing all (exposed) properties for an object (such as the form / element) using a for .. in loop.

    Maybe you could put up your form html (or the relevant section of) as an example of what's not working.

    Ed.
  4. #3
  5. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2001
    Location
    durban south africa
    Posts
    29
    Rep Power
    0
    What version of nestcape are u using ?
    Please don't say 6....

IMN logo majestic logo threadwatch logo seochat tools logo