SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Wizard Goof's Avatar
    Join Date
    Feb 2001
    Location
    Pittsburgh, PA
    Posts
    1,154
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    NS4, a Form, and NaN

    Why does the following code always return NaN in NS4 no matter what the value of the tmpm element is?

    Code:
    var theMonth = parseInt(document.goToMonth.tmpm.value)
    What would be the proper way to do this in NS4?

    Thanks,
    Goof
    Nathan Rutman
    A slightly offbeat creative.

  2. #2
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ummm - what are we working with?

    What is goToMonth - a form?

    why not use the forms collection?

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  3. #3
    SitePoint Wizard Goof's Avatar
    Join Date
    Feb 2001
    Location
    Pittsburgh, PA
    Posts
    1,154
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry flawless, I guess I was pretty vague. It turns out the problem was that I was simply being a goof! I was trying to access a select object by a value property instead of through it's options collection (which works fine in IE/NS6/Mozilla, but NS4 requires the proper syntax). My code is now:
    Code:
      var theMonth = parseInt(document.goToMonth.tmpm.options[document.goToMonth.tmpm.selectedIndex].value)
    (yes, goToMonth is a form)

    Thanks,
    Goof
    Nathan Rutman
    A slightly offbeat creative.

  4. #4
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


    So no problems now then?

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  5. #5
    SitePoint Wizard Goof's Avatar
    Join Date
    Feb 2001
    Location
    Pittsburgh, PA
    Posts
    1,154
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No problem

    Goof
    Nathan Rutman
    A slightly offbeat creative.


Bookmarks

Posting Permissions

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