如果我一个页面里包括有两个内嵌帧,我想用javascript改变form的target来分别把表单提交到这两个内前帧中去,我应该怎么做呢?
1<form action="" method="post" name="form1" target="">
2<iframe name="a"></iframe>
3<iframe name="b"></iframe>
4</form>
1<script>
2<!--
3document.form1.target="a";
4document.form1.action="url1";
5document.form1.submit();
6document.form1.target="b";
7document.form1.action="url2";
8document.form1.submit();
9//-->
10</script>
这样好象不行,为什么呢?我应该怎么做,谢谢!
---------------------------------------------------------------
1<iframe height="100" name="a" width="200"></iframe>
1<br/>
1<iframe height="100" name="b" width="200"></iframe>
1<form action="" method="post" name="form1" target="">
2<!--Put some input fields here.-->
3</form>
1<script>
2<!--
3document.form1.target="a";
4document.form1.action="url1";
5document.form1.submit();
6document.form1.target="b";
7document.form1.action="url2";
8document.form1.submit();
9//if "url1" and "url2" are both variables,do not put them between "".
10//-->
11</script>
---------------------------------------------------------------
我的建议是一个iframe对应一个form,他们的name可以动态生成!