Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detecting if a window is open to pass a value

Status
Not open for further replies.

rosn459

Programmer
Sep 18, 2003
37
0
0
US
How do I check if my popup window is open?

If it is already open, I want to pass a url.variable to it and keep any existing values still on the page.

Here is some code for the parent form.

<td>img src="Picture.gif" alt="" border="0" onClick="zoomToggle('100px','100px','200px','200px',this);"><br>Product Name One<br>
<A HREF="ShoppingCart.htm?ItemNum=12345&ItemDesc=ProductNameOne" target="_blank">Add To Basket</a>
</td>

Here is some code for the child form:
<body onLoad="addRow()">
<form action="ShoppingCart.htm" method="post" name="ShoppingCart.htm" id="ShoppingCart.htm">

<table border="1" cellspacing="1" cellpadding="1" bgcolor="##C6BBBB">
<th>Below are the item(s) you've selected:</th>
<tr><td>ITEM</td><td>NUM</td><td>QTY</td></tr>
<output>
<tr>
<td><input type="text" name="ItemDesc" value="#url.ItemDesc#"></td></output><td><output>#url.ItemNum#</output></td><td><input type="text" name="#url.ItemNumQty#" value="1" size="3" maxlength="10"></td>
</tr>

</table>

</form>
</body>


Thanks!

 
When you use window.open() to open a new window, it returns a handle to the window. You can then use this to check to see if the window (it points to) is open.

Google on window.open() and you should find some examples.

You can also then pass data back and forth (calling javascript functions on one page from the other page) - assuming that both windows are displaying content from the same domain (so as to avoid cross site problems in scripting).

Jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top