Thread: javascript

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Posts
    44
    Rep Power
    14

    javascript


    HELP

    I have a web page with 3 frames on a page. I am moving information from one frame to other using java script. An example of the line i am using is:

    parent.selectsquad.SelectSquad.goalkeeper1_id.value=play;

    selectsquad is the frame name
    SelectSquad is the form name

    When in ie 5 I have no problems the value of play moves across to the text box goalkeeper1_id no problem. However when I run the same page in netscape navigatopr 4.7 I get the following error message :

    parent.selectsquad.SelectSquad has no properties.

    Do I access the frame diffently in netscape?

    Kev
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2001
    Location
    Boston, MA
    Posts
    6
    Rep Power
    0

    Cool debug your script


    Try using alerts to figure out where your objects are.

    var myframe = parent.selectsquad;
    var myform = parent.selectsquad.SelectSquad;

    alert('frame: ' + myframe + '\nform: ' + myform);

    I think you've got the frame identified, but I'll bet there's something wrong with the way your addressing the form. Maybe it hasn't been created yet.

    Also, try using the frames[], forms[], and elements[] arrays to get at the object. Try testing them by returning the length of each.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2001
    Location
    Münster (Germany)
    Posts
    44
    Rep Power
    14
    If parent.selectsquad.SelectSquad.goalkeeper1_id is a selectbox you have to use this to make it work in both browsers:

    parent.selectsquad.SelectSquad.goalkeeper1_id[parent.selectsquad.SelectSquad.goalkeeper1_id.selected].value

    I think IE automatically knows that you want to know the value of the selected item of the selectbox, but somehow NN does not.

    Maybe this was not your problem?
  6. #4
  7. No Profile Picture
    Senior Citizen
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2001
    Location
    leftcoast
    Posts
    2,019
    Rep Power
    16
    parent.selectsquad.document.SelectSquad.goalkeeper1_id.value=play;

IMN logo majestic logo threadwatch logo seochat tools logo