I have a main document open in a browser and I created a pop-up window (with a link in it) to display when I loaded the browser. I want to click the link in the pop-up window and have it display the link's URL in the existing browser window. I also want to close the pop-up window upon clicking the link.
So far this is what I have:
With the existing code, the pop-up window opens upon loading and displays a link. When I click on the link the URL opens in the pop-up window (not in the main window) and the pop-up window does not close (I need it to close).
How can I get it to do what I want it to? Any help is greatly appreciated. Thanks!
Thanks for your help guys. I finally got it to work. Here is my code:
Put the code in the form.htm file instead of in your page. So leave that line above in to open the window, but in your form.htm make the link something like this (untested):
<a href="cwj.html" onclick="window.opener.location.href=this.href;window.close()">Click here</a>
Rob is spot on. I would like to suggest you do this for the main page. Drop the function 'showform', construct the anchor to the following:
<a href="form.htm" target="form" onclick="window.open(this.href, 'form');"> <b>Order 12 issues <br />for: $9.95*</b> </a>