Forum Moderators: open

Message Too Old, No Replies

Passing values from a child window to Parent window

Not working in Netscape

         

vijayksnkl

5:07 am on Nov 24, 2005 (gmt 0)



I want to pass values while the child window closes, but i cannot do it in Netscape, pls help me

[4]Parent.html[4]
<html>
<input type="button" value="PressMe" onclick="javascript:confirms()">

<script>
function confirms(){
mainwin = window.open('child.html');
}

[4]child.html[4]

<html>
<input type="button" value="Yes" onclick="return pressyes();return true;">
<input type="button" value="No" onclick="return pressno();return false;">
<input type="button" value="Cancel" onclick="window.close();">

<script>
function pressno(){
return false;
window.close();
}
function pressyes(){
return true;
window.close();

}
</script>
</html>

kaled

10:59 am on Nov 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The return statement causes execution of the function or event handler to terminate. Try this...

PARENT
<html>
<head></head>
<body>
<input type="button" value="PressMe" onclick="confirms(); return true">

<script type="text/javascript">
function confirms(){
mainwin = window.open('child.html');
}
</body>
</html>

CHILD
<html>
<head></head>
<body>
<input type="button" value="Yes" onclick="return pressyes()">
<input type="button" value="No" onclick="return pressno()">
<input type="button" value="Cancel" onclick="window.close(); return true">

<script type="text/javascript">
function pressno(){
window.close();
return false;
}
function pressyes(){
window.close();
return true;
}
</script>
</body>
</html>

HOWEVER, window.close() will close the calling window, and terminate scripting immediately I think.

Kaled.