急死了,这个问题有这么难吗?请各位指教

scholes3232 2003-07-31 12:43:51
一个submit的问题,我需要在一个页面的基础上点击按钮弹出另一个IE窗口,但如何在弹出页面中取得前一页面中的<input...>中的值;
<a href="./dingyu1.jsp" onClick="window.open(this.href,'newtxt','top=0,left=200,width=340,height=400,scrollbars=no,resizable=yes');return false;"><input type="submit" value="" style="background-image: url('template/img/dy_an.gif'); width: 49px; height: 18px; border-style: none; border-width: 0"></a>

请各位帮小弟一把!
...全文
20 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
形印声传 2003-07-31
  • 打赏
  • 举报
回复
上面那个是传递参数给opener,这个是取得参数:应该更适合你~~


1.htm
***********************
<html>
<head><title>1.htm</title></head>
<body>
参数一:<input type=text name=t1 value=参数一><br/>
参数二:<input type=text name=t2 value=参数二><br/>
<hr>
<input type=button name=b1 value="打开新窗口" onclick="window.open('2.htm','','')">
</body>
</html>

2.htm
***********************
<html>
<head><title>2.htm</title></head>
<body>
<script>
function get(){
tt1.value=window.opener.t1.value;
tt2.value=window.opener.t2.value;

}
</script>
<input type=text name=tt1><br>
<input type=text name=tt2>
<input type=button value=取得参数 onclick=get()>
</body>
</html>
形印声传 2003-07-31
  • 打赏
  • 举报
回复
简单啊,看看这个:
***************************
1.htm
***********************
<html>
<head><title>1.htm</title></head>
<body>
参数一:<input type=text name=t1><br/>
参数二:<input type=text name=t2><br/>
<hr>
<input type=button name=b1 value="打开新窗口" onclick="window.open('2.htm','','')">
</body>
</html>

2.htm
***********************
<html>
<head><title>2.htm</title></head>
<body>
<script>
function set(){
window.opener.t1.value="第一个参数";
window.opener.t2.value="第二个参数";
}
</script>
<input type=button value=传递参数 onclick=set()>
</body>
</html>
flyshp 2003-07-31
  • 打赏
  • 举报
回复
^_^

首先要确认你是否用IE浏览器,而不是类如飓风 或者 你自己作的浏览框架!!

(1) 你是用window.open 方法打开的弹出页面,也就是“_blank”一个新的ie,所以你可以把载体页的 input数据存入session 里,用的时候在新页用 session.getAttribut("xyz");取出就可以!
(2) 当你打开新页的同时,把input的信息用
<a href="./dingyu1.jsp?aa=&bb=&,,,,,," onClick="window.open(this.href,'newtxt','top=0,left=200,width=340,height=400,scrollbars=no,resizable=yes');return false;"><input type="submit" value="" style="background-image: url('template/img/dy_an.gif'); width: 49px; height: 18px; border-style: none; border-width: 0"></a>

传递就可以!
shyslysky 2003-07-31
  • 打赏
  • 举报
回复
1.aspx
<form id="Form1" method="post" runat="server">
<INPUT id="Text1" type="text" name="Text1" runat="server">
<asp:Button id="Button1" runat="server" Text="go "></asp:Button>
</form>

代码:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Response.Write("<script language=javascript>window.open('2.aspx?val=" + Text1.Value + "');</script>")
End Sub

2.aspx
<form id="Form1" method="post" runat="server">
<INPUT type="text" id="Text1" name="Text1" runat="server">
</form>
代码:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Text1.Value = Request("val") 'Put user code to initialize the page here
End Sub
BrightEye 2003-07-31
  • 打赏
  • 举报
回复
onclick="window.open('be.asp?id=<%=id%>&type=<%=type%>','')

87,918

社区成员

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

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