SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2000
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I've got a function writen in javascript. I can't figure out why it doesn't work with Netscape but works in IE. Does anyone know why?

    Thanks../Kenny

    function totalcheck() {

    var max = 8;
    var sum = 0;
    var adults = frmResInfo.S1202_NumberAdults.selectedIndex + 1; //plus 1 cus the array is offset by 1
    var children = frmResInfo.S1202_NumberChildren.selectedIndex - 0;
    sum = adults + children;

    if (sum > max) {
    alert("The number of adults plus the number of children cannot exceed 8.");
    frmResInfo.S1202_NumberAdults.selectedIndex = 0;
    frmResInfo.S1202_NumberChildren.selectedIndex = 0;
    }
    }

  2. #2
    JavaScript Guru (Big Ego) Arielladog's Avatar
    Join Date
    Jul 1999
    Location
    SC, USA
    Posts
    390
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey,

    Instead of:

    frmResInfo.S1202_NumberAdults

    try using:

    document.frmResInfo.S1202_NumberAdults

    I think that's the problem.

    aDog


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
  •