Google Chrome-无法使用javascript多次提交同一表单

Google Chrome-无法使用javascript多次提交同一表单,javascript,dom,google-chrome,Javascript,Dom,Google Chrome,我正在准备包装表单,它稍后会将我的查询发送到其他表单。在我的脚本中,我正在更改表单操作和存储查询的输入字段的名称。然后我使用.submit()多次发送准备好的表单。在FF和IE中,它起作用。在谷歌Chrome中,我注意到一个问题-表单只发送一次。只执行最后一个调用 有没有办法强迫它在Google Chrome中也工作 请看下面的代码(同样-问题只存在于谷歌Chrome): 函数formSubmit() { document.getElementById(“frm1”).target=“\u b

我正在准备包装表单,它稍后会将我的查询发送到其他表单。在我的脚本中,我正在更改表单操作和存储查询的输入字段的名称。然后我使用
.submit()
多次发送准备好的表单。在FFIE中,它起作用。在谷歌Chrome中,我注意到一个问题-表单只发送一次。只执行最后一个调用

有没有办法强迫它在Google Chrome中也工作

请看下面的代码(同样-问题只存在于谷歌Chrome):


函数formSubmit()
{
document.getElementById(“frm1”).target=“\u blank”;
document.getElementById(“frm1”).action=”http://www.w3schools.com/jsref/form_action.asp";
document.getElementById(“frm1”).fname.value='1111';
document.getElementById(“frm1”).submit();
document.getElementById(“frm1”).action=”http://www.w3schools.com/jsref/form_action.asp?salt=1";
document.getElementById(“frm1”).fname.value='2222';
document.getElementById(“frm1”).submit();
}
在下面的字段中输入一些文本,然后按“提交”按钮提交表单

名字:

使用的浏览器:

  • 谷歌浏览器:
    18.0.1025.142
  • Firefox:
    11.0
  • Internet Explorer:
    8.0.6001.18702

哦,还有。嗯。。。你的第一个帖子是到一个新窗口;我现在想起来有点可疑。我很确定我会把这称为Chrome中的一个bug,除非有一些规范说,在正常发布
后,无论是否有“目标”,表单都不能再次提交。你是对的,这确实是可疑的。在这里使用你的代码设置一把小提琴:。我无法使用Chrome(版本16.0.912.77M)复制问题哦,还有。嗯。。。你的第一个帖子是到一个新窗口;我现在想起来有点可疑。我很确定我会把这称为Chrome中的一个bug,除非有一些规范说,在正常发布
后,无论是否有“目标”,表单都不能再次提交。你是对的,这确实是可疑的。在这里使用你的代码设置一把小提琴:。我无法使用Chrome(版本16.0.912.77 m)复制此问题
<html>
<head>
<script type="text/javascript">
function formSubmit()
{
document.getElementById("frm1").target="_blank";    
document.getElementById("frm1").action="http://www.w3schools.com/jsref/form_action.asp";

document.getElementById("frm1").fname.value = '1111';
document.getElementById("frm1").submit();

document.getElementById("frm1").action="http://www.w3schools.com/jsref/form_action.asp?salt=1";

document.getElementById("frm1").fname.value = '2222';
document.getElementById("frm1").submit();
}
</script>
</head>
<body>

<p>Enter some text in the field below, then press the "Submit" button to submit the form.</p>

<form name="frm1" id="frm1" method="get">
First name: <input type="text" name="fname" /><br /><br />
<input type="button" onclick="formSubmit()" value="Submit" />
</form>

</body>
</html>