回 帖 发 新 帖 刷新版面

主题:各位高手帮帮忙

文件aaa.html

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript" type="text/javascript">
function aa(){
  window.showModalDialog("test2.htm")
  }
</script>
<base terget=_self>
</head>

<body>
<a href="javascript:" onclick="aa()">弹出</a>
</body>
</html>

文件test.html

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<base terget=_self>
</head>

<body>
<form id="form1" name="form1" method="post" action="?">
  <input type="text" name="textfield" />
  <input type="submit" name="Submit" value="提交" />
</form>
</body>
</html>


功能实现:
运行aaa.html文件有弹出两个字,,点击弹出两个字就会有一个"网页对话框"窗口弹出来.
弹出来的窗口内容是文件test.html的内容,,可是为什么文件test.html内容里有一个提交功能,,一点提交的时候,为什么会弹出一个新窗口????我想让它就在那个"网页对话框"窗口里运行提交功能,,可以吗?,,应该怎么做!!!!如果可以提供一下成功的代码,,谢谢!

回复列表 (共4个回复)

沙发

改成这样:
<form id="form1" name="form1" method="post" action="aaa.asp">
  <input type="text" name="textfield" />
  <input type="submit" name="Submit" value="提交" />
</form>

aaa.asp
中的内容是获取表单里的值。

板凳


window.showModalDialog("test2.htm")

改为:

window.open("test2.htm") 试试

3 楼


这位大哥,,你给我意见你的做法,,window.open("test2.htm")我会用可是我想实现的是那种window.showModalDialog("test2.htm")网页对话框的方法,,不过还是谢谢您...

4 楼


很感谢您的回复,, 不过我按照你的方法来试过了,,可是还是一样会,,打开一个新窗口

我来回复

您尚未登录,请登录后再回复。点此登录或注册