如何在模态对话框中进行提交而不新开窗口?
如果你 的 浏览器是IE5.5+,可以在对话框中使用带name属性的iframe,提交时可以制定target为该iframe的name。对于IE4+,你可以用高度为0的frame来作。例如: test6.htm
<script>
window.showModalDialog("test7.htm")
</script> test7.htm
if(window.location.search) alert(window.location.search)
<frameset rows="0,*">
<frame src="about:blank">
<frame src="test8.htm">
</frameset> test8.htm
<form target="_self" method="get">
<input name=txt value="test">
<input type=submit>
</form>
<script>
if(window.location.search) alert(window.location.search)
</script>
如果你 的 浏览器是IE5.5+,可以在对话框中使用带name属性的iframe,提交时可以制定target为该iframe的name。对于IE4+,你可以用高度为0的frame来作。例如: test6.htm
<script>
window.showModalDialog("test7.htm")
</script> test7.htm
if(window.location.search) alert(window.location.search)
<frameset rows="0,*">
<frame src="about:blank">
<frame src="test8.htm">
</frameset> test8.htm
<form target="_self" method="get">
<input name=txt value="test">
<input type=submit>
</form>
<script>
if(window.location.search) alert(window.location.search)
</script>
解决方案 »
- google map api v3 文字地标(labeledmarker)如何实现
- ISAPI_Rewrite做泛域名遇到的正则表达式问题,高手进来!
- cname1 和 cemail1 总是是undifend,不知道为什么?
- showModalDialog 中使用 locatin.href 问题
- 怎么判断鼠标是否在div的滚动条上?(现在没分,但我一定会追加)帮忙
- 请问 如何 删除 动态 创建的 对象 !!! 急!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- 关于Extjs柱形图,无法渲染
- 请给初学者个建议:学javascript有哪些好书?
- 关于textarea的滚动条问题
- 愁!愁!愁!谁来指点: 如何打印?
- 照书上抄的怎么就不行?
- javascript的脚本中的<input type='text' name='mcadd'>中能添加ID么?
test.aspx
<head>
<base target="_self">
</head>
<body>
<form runat=server target="ff" name="form2"></form>
里面有一个
<asp:textbox>(输入查询值)
<asp:dropdownlist>(这个里面是查询字段)如客户名称/客户地址
<asp:button>查询按钮还有一个<table>
</body>
但是我用javascrip返回值时提示"对象不存在"我返回值的脚本是 在table行onclick事件执行下面脚本返回值到主窗口function returnValue(rowObject) (rowObject 是行的ID)
{
var result=dialogArguments; --主窗口传过来的对象
var rowID=document.getElementId(rowObject.id);
result.text1.value=rowID.innerText;
window.close();
}我看了一下,总出现rowID是NULL值 不知道什么原因?
}
你的方法我也用了,不行哦,不会弹出新窗口,但提交时没有执行
你说的方法我也是这么用的
对话框刚打开时行对象(rowObject)是没问题
为什么我一执行"提交"把查好的数据放到TABLE后再执行table 行的onclick事件,行的id就是null值
JAVASCRIPT出错
我弄了一星期了,有谁来帮我看一下好不好:)
另外,你查询好的结果填充到table,你可以看看生成的html代码,id是不是已经变了?text1是服务端控件还是html控件?