父页面
<html>
<head>
<title>无标题页</title>
<script language="javas cript" type="text/javas
cript">
function opendialog1()
{
var someValue=window.showModalDialog("b.html","","dialogWidth=500px;dialogHeight=500px;status=no;help=no;scrollbars=no");
document.form1.p1t. value=someValue;
}
</script>
</head>
<body>
<form name="form1" act ion="#">
<input type="text" name="p1t">
<input type="button" value="打开对话框" on click="opendialog1()">
</form>
</body>
</html>
子页面
<html>
<head>
<title>无标题页</title>
<script language="javas cript" type="text/javas
cript">
function a(wname)
{
parent.window.returnValue=wname; //父窗口就是上一个页面
window.close();
}
</script>
</head>
<body>
<form name="form1" act ion="">
<input type="button" value="传值" on click="
return a('hello')">
</form>
</body>
</html>
<html>
<head>
<title>无标题页</title>
<script language="javas
function opendialog1()
{
var someValue=window.showModalDialog("b.html","","dialogWidth=500px;dialogHeight=500px;status=no;help=no;scrollbars=no");
document.form1.p1t. value=someValue;
}
</script>
</head>
<body>
<form name="form1" act
<input type="text" name="p1t">
<input type="button" value="打开对话框" on
</form>
</body>
</html>
子页面
<html>
<head>
<title>无标题页</title>
<script language="javas
function a(wname)
{
parent.window.returnValue=wname; //父窗口就是上一个页面
window.close();
}
</script>
</head>
<body>
<form name="form1" act
<input type="button" value="传值" on
</form>
</body>
</html>