| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1745 人关注过本帖
标题:如何在模态对话框中进行提交而不新开窗口?
只看楼主 加入收藏
sunxb008
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2004-9-13
收藏
 问题点数:0 回复次数:2 
如何在模态对话框中进行提交而不新开窗口?

例如:在当前窗口A下点击一链接,用showModalDialog方法打开一个输入查询内容的对话框B,输入查询内容后,将查询的内容显示在当前页面A下,而不打开新的窗口。 各位老大帮忙,大家一起来讨论一下啊

搜索更多相关主题的帖子: 模态 对话框 窗口 
2004-09-21 09:57
jawen
Rank: 1
等 级:新手上路
帖 子:25
专家分:0
注 册:2004-7-26
收藏
得分:0 

//A.htm

<html> <head> <script language="JavaScript"> function ok() { //window.open("B.htm"); form1.textfield.value=window.showModalDialog("B.htm"); //window.showModelessDialog("B.htm"); }

</script> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> </head> <body>

<form name="form1" method="post" action="B.htm"> <input type="text" name="textfield"> <input type="button"name="Submit" value="1---------&gt;2" onClick="ok()"> </form>

</body> </html>

//B.htm

<html> <head> <script language="JavaScript"> function pop() { window.returnValue=form2.textfield2.value; window.close(); } </script> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> </head> <body>

<form name="form2" > <input type="text" name="textfield2"> <input type="button" name="btn" value="button" onclick="pop()"> </form>

</body> </html>

不知上面的是否是你想要的?

2004-09-23 14:22
大光
Rank: 1
等 级:新手上路
帖 子:100
专家分:0
注 册:2004-5-25
收藏
得分:0 

在B里面 用 returnValue 返回值 传给 A,

然后在 A里面处里返回值,刷新A

var returnValue = window.showModelessDialog("B.htm");

if( returnValue != null )

{

search();

}

2004-09-24 17:47
快速回复:如何在模态对话框中进行提交而不新开窗口?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015412 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved