Jump to content

Populating dropdowns in opener... IE problem


kiernan7

Recommended Posts

Hey AJAX gurus!

 

I have a load of AJAX in some complicated forms.  We have lots of list boxes, and rather than populate them all with all of the options, we have the values in the table and an onClick() which fires a request for the values as needed.  This works fine everywhere.

 

But...

 

Recently we have added a new table that is the parent to a child table whose children feed a dropdown with a 'Go' button alongside it.  When clicking the 'go' a second window opens for editing of the child record.  All of this works fine as well.

 

But...

 

At the end (after a 'save') on the secondary window, I end with the window  having a single button that says 'Close Window'.  When the user clicks this, it fires a derivation of the original AJAX populating function (only with 'opener' added to the 'document.GetElementbyID' function).  This works fine in Firefox, but in Explorer it breaks!

 

For some reason, there seems to be a DOM difference between a 'self' window and an 'opener' window -- at least as it pertains to dropdowns.

 

Here is the code, and here's what breaks:

NOTE:  What I do here is feed back the list with a bar separator ("|") and then split it up.  Again, this works FINE with the 'self' window.  Also, all of these platform 'IFs' are new, I never needed them before on the original ('self') version of this.  HELP!!!!  TIA!

 

-- John Kiernan

 

response  = req.responseText;

var d = new Array();

d = response.split('|');

if (is_ie5up) {

} else {

  opentarget.length=0;

}

if (d.length > 0) {

for (i=0; i < d.length; i++) {

opttext = d;

optvalue = d;

    if (is_ie5up) {

opentarget.options  = opttext;

    } else {

opentarget.options  = new Option(opttext,optvalue );

}

}

} else {

    if (is_ie5up) {

opentarget.options  = "No Values";

    } else {

opentarget.options[0]  = new Option("No Values","");

}

}

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.