Appending option items in dropdown in parent window from dropdown in Child window in IE

Discussion in 'Javascript' started by Bostonasian, Feb 12, 2005.

  1. Bostonasian

    Bostonasian Guest

    I am trying to append options to dropdown in parent window from option
    items in child window.

    In parent window, I have following code:

    <script language="javascript">
    function AddItem2DropDown(item){
    exists = false;
    for(d=0;d<drpDwn.length;d++){
    if(drpDwn.options[d].value == item.value)
    exists = true;
    }
    if(exists == false)
    drpDwn.options[drpDwn.length] = item;
    }
    </script>

    Then in child window, I have following code:

    <script language="javascript">
    function AddItems(child){
    for(i=0;i<child.length;i++){
    if(child.options.selected == true)
    window.opener.AddItem2DropDown(child.options);
    }
    }
    </script>

    It works in Firefox, but not in IE6. Has anyone got this working in
    IE6?
    Bostonasian, Feb 12, 2005
    #1
    1. Advertising

  2. Bostonasian

    Bostonasian Guest

    Great! Thanks, your code works.
    Bostonasian, Feb 14, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    379
  2. Jeff Rodriguez
    Replies:
    23
    Views:
    1,084
    David Schwartz
    Dec 9, 2003
  3. Noel Dolan
    Replies:
    0
    Views:
    216
    Noel Dolan
    Jul 18, 2004
  4. Spammay Blockay
    Replies:
    1
    Views:
    401
    Dietmar Meier
    Feb 4, 2005
  5. Bitswapper
    Replies:
    5
    Views:
    119
    Prasad, Ramit
    Aug 27, 2013
Loading...

Share This Page