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

Parent and Child window problem 1

Status
Not open for further replies.

iMediaX

Programmer
Jul 27, 2003
4
AU
Hi All

I am a novice to Javascript, so this question might sound silly to most of you guys. Let me first describe what the situation is:

I have a form on the parent window. when the user clicks on the submit button, a new window pops up (ie a child window that displays a different asp page). Now depending on the selected inputs from the form, the child window will display a table of data. One column of each row in this table contains a hyperlink, which when click will change the parent's location (i.e window.opener.location).

The problem I have is that after the user clicks on the hyperlink, the parent window's location gets change but so does the child window's location. What I want is for the parent window's location to change but the child window's location to stay the same. And also I dont want the child window to close either.

I hope my description is not too vauge. Highly appreciated for any help on this.

Thanks guys

Regards

Kevin



 
It's probably to do with the way your hyperlinks are set up in the child window.

If you have:
Code:
<a href=&quot;someurl&quot; onclick=&quot;someJavaScriptFunction()&quot;>
Then the browser interprets this as: When someone clicks this link, first go and do someJavaScriptFunction(), then take the current browser window to someurl.

A couple of alternate methods:
Code:
<a href=&quot;someurl&quot; onclick=&quot;someJavaScriptFunction(); return false;&quot;>
<a href=&quot;#&quot; ononclick=&quot;someJavaScriptFunction()&quot;>
<a href=&quot;javascript:someJavaScriptFunction()&quot;>

Hope this helps you out.
 
It worked!! Thanks for your help!! By the way, this forum rocks!

Regards

Kevin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top