如何实现在showmodeldialog()弹出的窗口中提交form但不弹出新窗口。 这种问题以前已经有人提出过了! 在主页面中加入一个<iframe name=test style="display: none"></iframe>在showmodaldialog出来的页中用<form target=test …>…</form>。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 或者你把<form action=当前网页自身>就行了,这样这个页面作到既显示内容又能处理提交表单。 或者把 form 的 action 设为自身页。 这样的情况下,这个页必须既能显示内容,又能处理提交表单。(用 if response("submit") <> "" then ...判断. cawangjun(心驿) lvenlee(大头) 谢谢二位指正。我没有做实验,而想当然的轻易下结论实在是不对的。我希望shentj不是少女,不然险些酿成大祸。哈 lanbor(兰波) ,我当然不是少女;)谢谢几位 办法:window.showModalDialog("xxx.htm")xx.htm====================<frameset rows="0,*"><frame src="about:blank"><frame src="xxx.asp"></frameset>xxx.asp=========<form target="_self" method=post>以下是测试文件:index.htm=====================<input onclick='window.showModalDialog("f.htm")' type=button value="打开">f.htm=================================<frameset rows="0,*"><frame src="about:blank"><frame src="a.asp"></frameset>a.asp===============<script>function test(o){if(o.txt.value==""){alert("不能为空")return false}return true}</script><form method=post onsubmit="return test(this)" action="a.asp"><input name=txt><input type=submit></form><%Response.write "你输入的数据:" & Request.form("txt")%> 对于这个问题,先看看这个函数的构造:模式对话框:showModalDialogvReturnValue = window.showModalDialog(sURL[, vArguments][, sFeatures]);非模式对话框:showModelessDialog() (Internet Explorer 5 和以上版本)参数说明:·vReturnValue:对于showModalDialog(),它表示被打开的对话框窗口设置的returnValue属性值。对于showModelessDialog(),它表示新窗口对象。显然模式返回不了弹出的对话框对象,所以上述的方法都不可行,不知道楼上的各位发布的代码都试验过了没有。人家明显是问,如何在模式对话框中指向一个新的页面,而不是弹出新的页面。 在你弹出的对话框的<Head></Head>之间加上一句<base target="_parent"> jquery解析json的一个菜鸟问题 用户在线时间停留统计? Ext.data.Store 的相关问题 请教一个js切换问题 我的脚本不运行是什么原因 javascript截取前面N个字代码怎样写? 我想在电脑上装两套IE,一个IE6一个IE5怎么实现啊? 怎么样把一个小数的小数都去掉,只留下整数? 怎么控制页面全局的字体大中小效果,求大神指点。 javascript的执行顺序 没的混了:(,看看下面介绍吧 IE6下的document.body=null,这是为什么?
我没有做实验,而想当然的轻易下结论实在是不对的。
我希望shentj不是少女,不然险些酿成大祸。哈
谢谢几位
window.showModalDialog("xxx.htm")xx.htm
====================
<frameset rows="0,*">
<frame src="about:blank">
<frame src="xxx.asp">
</frameset>xxx.asp
=========
<form target="_self" method=post>以下是测试文件:
index.htm
=====================
<input onclick='window.showModalDialog("f.htm")' type=button value="打开">
f.htm
=================================
<frameset rows="0,*">
<frame src="about:blank">
<frame src="a.asp">
</frameset>
a.asp
===============
<script>
function test(o)
{
if(o.txt.value=="")
{
alert("不能为空")
return false
}
return true
}
</script>
<form method=post onsubmit="return test(this)" action="a.asp">
<input name=txt>
<input type=submit>
</form><%
Response.write "你输入的数据:" & Request.form("txt")
%>
模式对话框:showModalDialog
vReturnValue = window.showModalDialog(sURL[, vArguments][, sFeatures]);非模式对话框:showModelessDialog() (Internet Explorer 5 和以上版本)参数说明:
·vReturnValue:对于showModalDialog(),它表示被打开的对话框窗口设置的returnValue属性值。对于showModelessDialog(),它表示新窗口对象。
显然模式返回不了弹出的对话框对象,所以上述的方法都不可行,不知道楼上的各位发布的代码都试验过了没有。人家明显是问,如何在模式对话框中指向一个新的页面,而不是弹出新的页面。
一句<base target="_parent">