代码来自JKHtml/ZZZ-else/CommonJSFunction.js
http://download.csdn.net/source/276201
------
说明:
第一个参数是form对象,
第二第三个参数与window.open的第二第三个参数相同/**
* This function is to submit a form to a new window.
* JK 2007-03-06
*/
function submitToNewWin(formObj,sName,sFeatures){
window.open('about:blank',sName,sFeatures);
var originalTarget=formObj.target;
formObj.target=sName;
formObj.submit();
formObj.target=originalTarget;
}

解决方案 »

  1.   

    主页面
    var array = new Array{value1,value2,...};
    var result = window.showModalDialog("print.html",array,"dialogWidth=500px;dialogHeight=300px;status=no");
    子页面
    var array = window.dialogArguments;
      

  2.   

    用position:absolute,这样就不会把别人挤走。<table border="1" width="100%">
      <tr>
        <td width="50%">a </td>
        <td width="50%">b </td>
      </tr>
      <tr>
        <td width="50%"><div style="position:absolute;">fdsafdsa fdsa fdsa fdsa fdsafdsa fdsa fdsafdsafdsafdsc</div> </td>
        <td width="50%">d </td>
      </tr>
    </table>
      

  3.   

    jk_10000 你好 我按照你的做法  已经可以实现 表格跟背景图很好结合  不会撑大!!!
    但是问题又来了
    1、 在按 “打印预览”时  
    无法看到任何数据  是不是用了 div 有关系 ??我的预览代码:<input type="button" value="打印预览" accesskey="O" onclick="document.all.WebBrowser.Execwb(7,1)">2、还有 在 表单提交时  能否控制print.asp 的窗口大小   ? 我在print.asp  用你的方法  已经布置好的格式 ,而弹出来的print.asp 都是最大化的 数据又乱掉了  没有对准格式  ?我的提交代码:
    <form name="input1" METHOD=POST ACTION="print.asp" target="_blank">
      

  4.   

    不会把 高手都去过节日了??????我已经改了部分代码 
    <form name="input1" method="post" action="saveinfo.asp" >  //把表单提交给另一页面(可以成功保存)
     <script language="javascript">
    function openprint(){
      window.open ("print.asp", "newwindow", "height=500, width=712, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no")
       }
    </script><input type="submit" name="ok" value="确定" onclick="openprint()">  //在保存同时 弹出print.asp 也可控制窗口大小  问题是没办法获取刚才入库的数据??????????? 能否从数据库里检索????
    高手赐教!!!!