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
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