http://www.csdn.net/Develop/read_article.asp?id=15113

解决方案 »

  1.   

    showModalDialog提交的问题,如何让其不出现新页面!!!
    http://expert.csdn.net/Expert/topic/781/781508.xml?temp=.7678644
      

  2.   

    var sFeatures ="dialogHeight:300px;dialogWidth:500px;dialogTop:250px;dialogLeft:250px;help:no;status:no;scroll:no;dialogHide:1"
    var returnValue = window.showModalDialog("/dialog.htm","",sFeatures) ;

    dialog.htm:<html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>系统登录</title>
    </head></script>
    <body bgcolor="#e9e5d9" topmargin=3>
    <IFRAME frameBorder=0 name=winshow2 target="_self" height="100%" src="timeout.htm" width=100%></IFRAME>
    </body>
    </html>timeout.htm
    含表单文件<html><head>
    </head><body><form method="POST" action="timeout.jsp">
      <input type="text" name="T1" size="20"><input type="submit" value="提交" name="B1"><input type="reset" value="重置" name="B2"></p>
    </form></body></html>
      

  3.   

    上面这个办法  真正打开的是timeout.htm ,并且 使 在timeout.htm操作后产生的页面替换了timeout.htm 。我就是这个意思,但它用到了dialog .htm,用它来过渡, 但是我有很多象timeout.htm 一样要求显示的页面,那我不就要用到很多对应的过渡表吗,那不是太浪费了,有没有更好的办法。
      

  4.   

    模态对话框可以提交给自己, 不过不要用iframe,用frame,我就是这样做的,把一个frame隐藏掉,另外一个提交的时候把taget="_self",就行了

    frame.html<frameset rows="0,*">
      <frame src="about:blank" frameborder="0" noresize width="0" height="0" style="display: none;">
      <frame src="AddCard.html" frameborder="0">
    </frameset>AddCard.html
    ...
    <form action="frame.dll" method="post" target="_self" name="fr_card" id="fr_card" onsubmit="return check()" enctype="multipart/form-data">
    ...提交后的页面也在对话框中出现
      

  5.   

    1 为什么不要用iframe,
    2 你说的方法也用了frame.html作为过渡不是直接用AddCard.html
      

  6.   

    借qiudehuo(段云霄) 的例子,注意改变的地方timeout.htm
    含表单文件
    <html>
    <head>
    <script>
    name = "mywin"; // 给窗口命名
    </script>
    </head>
    <body>
    <form method="POST" action="timeout.jsp" target="mywin">
      <input type="text" name="T1" size="20"><input type="submit" value="提交" name="B1"><input type="reset" value="重置" name="B2"></p>
    </form>
    </body>
    </html>
      

  7.   

    漏了一点,打开模态窗口用
    var returnValue = window.showModalDialog("timeout.htm","",sFeatures) ;