<form action="http://localhost/action1.jsp" name="outer" onsubmit="window.frames['ccgp'].document.outer.submit()">
<input type=text name="title" value="">
</form><iframe name="ccgp" style="display:none" src="iframe.jsp" target="_blank">
<form action="http://localhost/action2.jsp" name="outer">
<input type=hidden name="title" value="">
</form>
</iframe>
</html>
<input type=text name="title" value="">
</form><iframe name="ccgp" style="display:none" src="iframe.jsp" target="_blank">
<form action="http://localhost/action2.jsp" name="outer">
<input type=hidden name="title" value="">
</form>
</iframe>
</html>
解决方案 »
- 问一下
- Extjs 如何设置 弹出消息框Msg位置
- 高手来救我啊,一个小问题我折腾了7个小时了,有代码很简单
- 求javascript与数据库实现的书型菜单实例`
- 在用DHTML動態生成「Buton」時、怎麼加「Click Event」
- 树型菜单的JS代码,急用200分相送
- 100分请高手相助!
- 怎么取得<html:select .../>标签中的值和名称?这个问题搞了我一个星期了。没有结果...
- 抢分喽!在网页中,如何控制浏览器中的刷新按钮变灰
- 微软主页那样的菜单,是怎么做的?100分奉上,在线等……
- 请问可以将英文的全形字符转化为相应的半角的英文字符吗?
- 关于在 在线html编辑器 中插入图片不显示的问题
1、分别给两个form不同的命名
2、提交的时候使用js脚本各自提交
3、参考下面:<form action="http://localhost/action1.jsp" name="outer">
<input type=text name="title" value="">
<input type=button name='outerSubmit' onclick='document.all.outer.submit();'>
</form><iframe id="ccgp" style="display:block" src="">
<form action="http://localhost/action2.jsp" name="inner">
<input type=hidden name="title" value="">
<input type=button name='innerSubmit' onclick='document.all.inner.submit();'>
</form>
</iframe>
</html>
<form action="http://localhost/action1.jsp" name="outer" onsubmit="fun()">
<input type=text name="title" value="">
</form>
<iframe id="ccgp" style="display:none">
<form action="http://localhost/action2.jsp" name="inner">
<input type=hidden name="title" value="">
</form>
</iframe>
</html>
其中fun()这个方法应该怎样写呢?
window.frames['ccgp'].document.outer.submit();
}
window.frames['ccgp'].document.outer.submit();
}
function fun(){
window.frames['ccgp'].document.title.value=window.document.all.title.value;
...//此处可以添加提交其它表单而不能是外部的outer,只是fun()是你的外部表单outer的onsubmit触发提交因此你不可以在这里再次提交该表单
window.frames['ccgp'].document.outer.submit();
}
奇怪!我用您的方法就是得不到iframe中的表单对象
function fun(){
window.frames['ccgp'].document.inner.elements[ "title "].value=document.outer.elements[ "title "].value;///////////这行就报错了
window.frames['ccgp'].document.inner.submit();
document.outer.submit();
}
不要用title等关键字
iframe的name不是id
[ "title "]里面有空格
1.htm
<body>
<form name=a action=http://community.csdn.net/ target=_blank>
<input type=submit onclick="window.frames['c'].document.b.submit()">
</form>
<br>
<iframe name=c src="2.htm"></iframe>
</body>2.htm
<body>
<form name=b action="http://news.sina.com.cn" target=_blank>
<input value="ok">
</form>
</body>