怎么把弹出窗口的值传回来~

startnow 2003-08-18 02:43:30
第一个页面
<input type=text name=aaa>
<a href onclick="window.open('upload/upload.php','','toolbar=0,location=0,status=0,menubar=0,width=500, height=350, scrollbars=1,resizable=0')">上传文件</a>

upload.php 页面为上传文件处理页面

如何做到upload.php上传完文件后 把文件名 付值到<input type=text name=aaa>这个输入框内容呢?
...全文
28 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
gz
hover_online 2003-08-18
  • 打赏
  • 举报
回复
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>子父窗口的操作</title>
</head>
<body>
<script>
var win=null;
function op(){
win=window.open("about:blank","win","width=200,height=200");
win.document.write("<input type='button' value='关闭父窗口' onclick='window.opener.opener=null;window.opener.close()'>");
win.document.write("<input type='button' value='刷新你窗口' onclick='window.opener.location.reload()'>");
}
</script>
<input onclick="op()" value="打开窗口" type="button"><input type="button" value="最小化" onclick="if(win&&win.open&&!win.closed){win.resizeTo(0,0);win.moveTo(0,window.screen.width);}else alert('还没有打开窗口或已经关闭')"><input type="button" value="最大化" onclick="if(win&&win.open&&!win.closed){win.moveTo(-4,-4);win.resizeTo(screen.availWidth+8,screen.availHeight+8);}else alert('还没有打开窗口或已经关闭');"><input type=button value="关闭子窗口" onclick="if(win&&win.open&&!win.closed){win.opener=null;win.close()}else alert('还没有打开窗口或已关闭')"><input type=button value="刷新子窗口" onclick="if(win&&win.open&&!win.closed){win.location.reload();win.focus()}else alert('窗口还没有打开或已关闭')"><input type="button" value="看子窗口的大小" onclick="if(win&&win.open&&!win.closed){alert(win.document.body.clientWidth+'*'+win.document.body.clientHeight);win.focus();}else{alert('还没有打开窗口或者已关闭')};">
</body>
</html>

看看这个!
kingdomzhf 2003-08-18
  • 打赏
  • 举报
回复
test.html
<body>
<input type=text id=aa>
<input type=button onclick="window.opener.document.all('aaa').value=aa.value" value=upload>
</body>

test6.html
<input type=text name=aaa>
<a href onclick="window.open('test.html','','toolbar=0,location=0,status=0,menubar=0,width=500, height=350, scrollbars=1,resizable=0')">上传文件</a>

LingToSs 2003-08-18
  • 打赏
  • 举报
回复
能给个例子码? 谢谢
胖河马 2003-08-18
  • 打赏
  • 举报
回复
在弹出的窗体中用window.opener可以引用父窗体
fason 2003-08-18
  • 打赏
  • 举报
回复
opener.document.all.aaa.value="***"

87,904

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧