Safari-HTML表单已提交两次。怎么预防呢?

时间:2013-06-11 10:27:41

标签: javascript html forms web-applications safari

我有以下代码

function submitSelf() { 
  var adhocMainJspPane = getFrameObject('adHocMainJSPPane',openerObject);
  document.Form.action="something";
  document.getElementById("tabID").value = adhocMainJspPane.cubeTreeFrame.document.getElementById("arePropertiesChanged").value;
  document.selfCloseForm.target="advancedPropertiesJSPPane";
  var tmpSum = getTmpSum();     
  document.selfCloseForm.action += "&tmpChk="+tmpSum;
  document.selfCloseForm.method="post";
  document.selfCloseForm.submit();
}

脚本中没有其他提交。 Html是

<BODY onload="submitSelf();">
  <FORM name="selfCloseForm" id="selfCloseForm" action="" method="post">
    <INPUT type="hidden" id="tabID" name="tabID" value="">
    <INPUT type="hidden" id="fromPage" name="fromPage" value="">
    <INPUT type="hidden" id="elementNo" name="elementNo" value="">
    <INPUT type="hidden" id="elementName" name="elementName" value="">
    <INPUT type="hidden" id="cubeAction" name="cubeAction" value="">
    <INPUT type="hidden" id="arePropertiesChanged" name="arePropertiesChanged" value="">
  </FORM>
<BODY>  

上述内容在SAFARI浏览器上提交两次。如何防止它这样做。

0 个答案:

没有答案