将提交表单的按钮改为<input type="button" value="提交" onclick=Post()>
在data.asp中增加一个检测表单并提交表单的函数如下:
<script>
function Post(){
  ......
  检测要提交的表单数据
  ......
  newWin = window.open("confirm.asp","newWin")  document.formname.target=newWin  document.formname.submit()}

解决方案 »

  1.   

    <!--form target参数开新窗口-->
    <form action=confirm.asp target="_blank" name=testform onsubmit="return test()">
    <input type=text name=testtext>
    <input type=submit>
    </form><script>
    function test(){
       if (testtext == ""){
          alert("没有数据");
          return false;
       }
       else
          return true;
    }
    </script>
      

  2.   

    <!--form target参数开新窗口-->
    <form action=confirm.asp target="_blank" name=testform onsubmit="return test()">
    <input type=text name=testtext>
    <input type=submit>
    </form><script>
    function test(){
       if (testform.testtext == ""){
          alert("没有数据");
          return false;
       }
       else
          return true;
    }
    </script>最好写全些