Posts: 215
Name: Syed Saadat Ali
Location: Lahore, Pakistan
|
Here goes the solution (please modify as per your requirements):
Parent.html:
HTML Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script language="JavaScript" type="text/javascript">
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
if(popUpWin)
{
if(!popUpWin.closed) popUpWin.close();
}
popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}
</script>
</head>
<body>
<form method="get" name="form1">
<input name="txt" type="text">
<a href="#" onclick="popUpWindow('child.html', 50, 50, 200, 200)">Click to Open Child</a>
</form>
</body>
</html>
Child.html:
HTML Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<form method="get" name="form1">
<input name="txt" type="text">
<a href="#" onclick="window.opener.document.form1.txt.value=document.form1.txt.value; window.close();" >Click to Set Value in Parent</a>
</form>
</body>
</html>
__________________
- -- --- ---- ----- ------ ------- ---------------
If you have knowledge, let others light their candles in it.
|