看看这个!比较急!

zhyoli 2003-12-26 03:04:36
我想实现这样一个效果。
1.asp
2.asp
在这个1.asp页面上有个上传按妞。点击后.由2.asp处理上传。成功后关闭2.asp。把得到的文件名插入到1.asp里的nr文本框里。怎么实现。
谢谢!
...全文
23 19 打赏 收藏 转发到动态 举报
写回复
用AI写文章
19 条回复
切换为时间正序
请发表友善的回复…
发表回复
longshenwang 2003-12-26
  • 打赏
  • 举报
回复
response.write "<script>alert('执行否');self.opener.document.form1.nr.value='dfsdf'</script>"

看看有没有执行
zhyoli 2003-12-26
  • 打赏
  • 举报
回复
没有用的。
大家再帮忙看看!
zhyoli 2003-12-26
  • 打赏
  • 举报
回复
无奈!格式怎么写!
放到这里面。怎么写
response.write "<script>self.opener.document.form1.nr.value='dfsdf'</script>"是这样吗?好象没有反映!
luobinsen 2003-12-26
  • 打赏
  • 举报
回复
look
longshenwang 2003-12-26
  • 打赏
  • 举报
回复
就用self.opener.document.form1.nr.value='dfsdf'(在2.asp里面写)就可以了
zhyoli 2003-12-26
  • 打赏
  • 举报
回复
应该怎么写。帮我写一下吧。兄弟分不够。可以再加的!:(
zhyoli 2003-12-26
  • 打赏
  • 举报
回复
一个上。也就是1.asp里
在1.asp里有个按钮。点击弹开新窗口2.asp。处理上传程序。返回文件名传递到1.asp里的form1.nr.value里
longshenwang 2003-12-26
  • 打赏
  • 举报
回复
self.opener.document.form1.nr.value='dfsdf'
longshenwang 2003-12-26
  • 打赏
  • 举报
回复
上上一个 两个上 ???
zhyoli 2003-12-26
  • 打赏
  • 举报
回复
是这样的。上传连接到的是新窗口。在新窗口中实现了上传功能。然后返回得到的文件名插入到上上一个也面的form1中的nr文本框中的当前光标。
longshenwang 2003-12-26
  • 打赏
  • 举报
回复
self . opener . document . all . nr . value
当前页 父亲页 对象 所有元素
zhyoli 2003-12-26
  • 打赏
  • 举报
回复
不行。没有把得到的文件名传递给1.asp页面上的文本框里!
这是关联代码。帮忙看一下!
if right(PhotoPath,1)<>"/" then PhotoPath=PhotoPath&"/"
datetime=year(date)&month(date)&day(date)&hour(now)&minute(now)&second(now)
session("filename")=datetime&fileext
file.SaveAs Server.mappath(PhotoPath&session("filename"))
response.write "<script>self.parent.document.form1.nr.value='dfsdf'</script>"
response.write "<script>javascript:window.opener=null;window.close();</script>"
aoenzh 2003-12-26
  • 打赏
  • 举报
回复
我一直再找这个东西
tangzehuan 2003-12-26
  • 打赏
  • 举报
回复
1.asp:
------------------------------------------
<form name="productform" method="post" action="2.asp" target="BackFrame" enctype="multipart/form-data">
<input type=text name=filename>
.......
</form>
<iframe name="BackFrame" width="0" height="0" src="about:blank"></iframe>


2.asp:
------------------------------------------
<%
'上传文件,在此省略
....
....
....

'返回文件名strFileName
response.write "<script>window.parent.document.productform.filename.value='" & strFileName & "';</script>"

%>
longshenwang 2003-12-26
  • 打赏
  • 举报
回复
但是如果不用open打开既 2.asp页面也是在框架里面打开的 (不是新的窗口)

就要改成
var flag=0;//上传成功标记
if(flag=1){
alert("上传成功!");
self.top.frames['mainframe'].document.all.nr.value="文件名"
}
longshenwang 2003-12-26
  • 打赏
  • 举报
回复
hoho open是笔误 不好意思

应该是opener

不管你的1.asp是在什么页 只要是用open方法打开的2.asp页面(如上面写的)就可以用我这种方法更新1.asp了!


zhyoli 2003-12-26
  • 打赏
  • 举报
回复
self.open.document.all.nr.value
open 是什么意思?all哪? 我的1.asp页面上的form名称是form1.1.asp页面在位于框架页面的mainframe里。
怎么样写?能详细一点吗?
zhyoli 2003-12-26
  • 打赏
  • 举报
回复
self.open.document.all.nr.value
open 是什么意思?all哪? 我的1.asp页面上的form名称是form1.1.asp页面在位于框架页面的mainframe里。
怎么样写?能详细一点吗?
longshenwang 2003-12-26
  • 打赏
  • 举报
回复
在1.asp 里面有一个按钮<input type="button" value="上传" onclick="window.open("2.asp","","")">

还有一个文本框nr


在2.asp里面 最后有一个判断
var flag=0;//上传成功标记
if(flag=1){
alert("上传成功!");
self.open.document.all.nr.value="文件名"
}

87,907

社区成员

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

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