三重form提交

网上大多都说form表单不能重叠,经过测试可以通过js来实现form多重提交

 

Html:

  <iframe id="testFrame2" name="testFrame2" src="" style="display:none;"></iframe>
  <iframe id="testFrame" name="testFrame" src="" style="display:none;"></iframe>
  <form id="testForm" name="testForm" action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" onsubmit="doSubmit();">

 

JS代码:

function doSubmit(){
 testForm.action = "
http://.....";
 testForm.target = "testFrame";
 testForm.submit();
 testForm.action = "http://...";
 testForm.target = "testFrame2";
 testForm.submit();
 testForm.action = "<?php echo str_replace('&', '&amp;', $action); ?>";
 testForm.target = "_self";
}

你可能感兴趣的:(html,iframe,function,测试,action)