81,092
社区成员
发帖
与我相关
我的任务
分享
function selectOrg(id,name){
if(window.opener){
window.opener.document.all.orgId.value=id;
window.opener.document.all.orgName.value=name;
window.close();
}
}
<html>
<head>
<title></title>
<script>
function opendialog()
{
var selectValue=window.showModalDialog("c.html","","dialogWidth=500px;dialogHeight=500px;status=no;help=no;scrollbars=no");
document.formp.name.value=selectValue;
}
</script>
</head>
<body>
<form name="formp" action="">
<input type="text" name="name">
<input type="button" value="选择" onclick="opendialog()">
</form>
</body>
</html>
<html>
<head>
<title>无标题页</title>
<script>
function callback(name)
{
parent.window.returnValue=name;
window.close();
}
</script>
</head>
<body>
<form name="formc" action="">
<input type="button" value="传值" onclick="return callback('name')">
</form>
</body>
</html>