The first window calls window.open(URL, "AddToCart");
The new window (AddToCart), has a button which calls top.opener.submit();
It appears that there is no submit() function on top.opener.
In window AddToCart, I can say alert(top) and get a window saying [object]. I can say alert(top.opener) and [object] pops up. But when I say alert(top.opener.submit()), nothing happens. Where is the submit() function?
The submit method is not a method of window, rather, a method of HTMLFormElement. Therefore, you'll have to get a reference to the form in the opener window and then call its submit method.
I can't get a handle to the form that's in top.opener.
In other words (to continue the way I was explaining it before), if I say alert(top.opener), I get [object]. But if I execute alert(top.opener.forms), I get nothing. Likewise, I get nothing if I try alert(top.opener.forms[0]) or alert(top.opener.forms['_HandleDispThumbForm'] (where "_HandleDispThumbForm" is the unwieldy name of the form I'm trying to submit.
How do I figure out what object, and what type of object, I have a handle to? In other words, I want to print more than just [object] when I execute alert(top.opener). I can get all of the properties (forall prps in top.opener), but they don't tell me anything of value either -- except that there is no forms property.
That's OK, apparently so did I. I posted just before leaving for the day and based on your original post overnight I realized how to get to the answer.
Bookmarks