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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Close popup window on selection

Status
Not open for further replies.

seraaj

Programmer
Dec 19, 2002
7
US
Am having a hard time with this.

Have opened a popup window (using javascript) displaying two choices. Visitor selects one of the items showing so he/she can be sent to the relevant page.

Problem is I also want the popup window to close when the user makes that selection. Need help doing this.

The items representing the choices are both defined by <a> tags.

Here is relevant code:

Are you sure you want to proceed?
<a href= back to beginning</a>
<p>
<a href= jump ahead</a>

How do I code it so that selecting either item will send the user on AND close the popup window at the same time?

Any help appreciated.
 
Code:
<a href = &quot;[URL unfurl="true"]http://www.domain.com/page1.asp&quot;[/URL] onClick = &quot;window.close()&quot;>Go back to beginning</a>

vlad
 
Thanks for the reply. Doesn't work for me, though.

I think the problem here is that
1) the popup window is calling the link to domain.com, and domain.com is being loaded in the popup window.
2) then, when the popup window is closed, the domain.com link is also closed.

The trick here is to get the domain.com link to load up NOT IN THE POPUP WINDOW, but back in the original referring page. (or any other window, for that matter).

Any additional thoughts on how to accomplish this?
 
sounds like you want to send a value back to the opening page....

<script>
function makeChoice(inVal){
window.opener.formName.formField.value = inVal
window.opener.focus()
self.close()
}
</script>

<input type=button onClick=&quot;makeChoice('blue')&quot; value=&quot;Blue&quot;>
<input type=button onClick=&quot;makeChoice('red')&quot; value=&quot;Red&quot;> Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048

mikewolf@tst-us.com
 
Many, many thanks to both of you for your help!!! Problem solved.

vvlad-- this was EXACTLY what I needed.


mwolf00-- you anticipated a need I have in another area of my site.

I REALLY appreciate the help. Thanks again to the both of you!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top