New Window Problem

N

nattyyl

Hi All,
I have a link on a HTML page which when clicked pops up
a new window if a condition is satisfied.
If the new window opens, I want the parent window to remain
on the same page,until the user clicks OK in the popup window.
My problem is that the parent window does not remain on the
same page,even though i return a false from the javascript
function.Here is the code.Please let me know where I'm wrong

Code on Parent window(Page1)

<script language="JavaScript">
function testPage(varOne,varTwo,varThree){
var newWin;
var winURL = "page3.html";
if(varOne){
newWin = window.open(winURL,'newWindow');
if(!newWin.closed && newWin != null){
newWin.document.forms[0].hiddenValue_one.value = varTwo;
newWin.document.forms[0].hiddenValue_two.value = varThree;
}
return false;
}
else{
return true;
}
}
</script>
<a href = "page2.html" onclick ="return testPage(true,one,two);">
link to page 2</a>

In my case "Page3" pops up but also the parent window goes to
"Page2",where as I want it to remain on Page1.
Thanks for all your help in advance.
Natty
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top