Click to See Complete Forum and Search --> : Parent Window


gsmith
03-21-2003, 10:45 PM
Hello all,

I was hoping someone could provide me some direction. I am using the window.open command to create a new window to display accessory items. On this page I would like to update the URL of the orginal window to add the accessory items to the cart.

I am using the following code, but it does not reference the original window. It simply reloads the accessory window.

Thanks in advance!

Var ParentWnd

function AddItem(ProdID)
{
ParentWnd = window.parent;
ParentWnd.focus();
ParentWnd.location = "/shop/welcome.asp?AddItem="+ProdID;
return false;
}

Any Ideas? Thanks!

gsmith
03-21-2003, 11:20 PM
Thanks!

gsmith
04-07-2003, 09:25 AM
Thanks again for the previous help. I was wondering if you might be able to help me out again.

I have a pop up that has a Javascript WYSIWYG editor in it. Upon completion of the edit, I need to save the information and reload the parent window. I have used Javascript to update a element & submit the form on the same page, but is it possible to to that with the parent window?

window.opener.document.forms['ProdEdit'].txOverview.value = cleanup(document.all.ewe.innerHTML);
window.opener.document.forms['ProdEdit'].submit();

If this is not possible, is it possible to submit the form back to the parent window?

Thanks in advance

gsmith
04-07-2003, 03:04 PM
Just thought i would follow up on this post. I was able to get it working, I had simply mistyped the form element name in the statement.
It should have been:

window.opener.document.forms['ProdEdit'].txtOverview.value = cleanup(document.all.ewe.innerHTML);
window.opener.document.forms['ProdEdit'].submit();
window.close();

I just wanted to update the thread so that if anyone else was experiencing problems with similar code.