Click to See Complete Forum and Search --> : HTML new window problem


Gautham_2003b
04-30-2005, 12:49 AM
Hi guys ,
I have a strange problem, may be silly/easy for some guys. Here is it:

I have a parent IE window and I want to open new child window( eg: new window.open(xyz.html,"","");)
and when few changes are made and when i close the child window parent window should be refreshed and should get new values.

I am struggling to solve since 2 days. Please help me out by giving a simple example code.plz.

Fang
04-30-2005, 02:55 AM
This is the way to pass data to the parent/opener window from the child.
Opener:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>Parent window</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
<!--
function childWindow() {
var oChild=window.open("windowChild.htm", "child","height=200, width=400");
}
//-->
</script>
</head>
<body>
<form action="#" name="form_1">
<div>
<button type="button" onclick="childWindow();">Open childWindow</button>
<label>Child data: <input type="text" name="input_1"></label>
</div>
</form>
</body>
</html>

Child window (windowChild.htm):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>Child window</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
<!--
onunload=function() {
opener.document.form_1.input_1.value=document.form_child.input_1.value;
}
//-->
</script>
</head>
<body>
<form action="#" name="form_child">
<div>
<label>Text to pass to parent: <input type="text" name="input_1"></label>
</div>
</form>
</body>
</html>

cabinetdoors
05-16-2005, 02:59 PM
I am using select boxes in the child. Can you show me the code???thanks...bob