给iframe设置一个name,然后设置表单的target不行吗?

解决方案 »

  1.   

    模态对话框是不能提交给自己的,包括提交给模态对话框里的iframe也不行, 一提交就会跳出新网页. 当然模态对话框也不接受表单的提交, 解决你这人问题的办法就是用打开模态对话框时的第二个参数(vArguments)
      

  2.   

    举个例子:
    showModalDialog('tt.htm', 'meizz','dialogWidth:360px;dialogheight:120px;status:no;help:no')在tt.htm里:
    <iframe name=contentIframe style="scroll:no;" frameborder=0 width=100% height=100% ></iframe>
    <script language="javascript"><!--
    if (window.dialogArguments != null)
      window.document.all.contentIframe.src = "abc.asp\?msg="+ window.dialogArguments;
    </script>这样就把你想要的信息传进去了,当然你还将一个数组组装成一个字符传进去以后再解开来就可以传递更多的内容了.传值方法二:
    showModalDialog('tt.asp\?msg=meizz', '','dialogWidth:360px;dialogheight:120px;status:no;help:no')
    用这种方法直接将值赋在模态对话框的链接上,然后到了对话框里你自己再接收处理
      

  3.   

    模态对话框可以提交给自己, 不过不要用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">
    ...
      

  4.   

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

  5.   

    楼上的两种方法都是可以的,但是都有受到参数或参数内容过多的限制。
    楼主对这种方法我想应该也知道,但好象又只能用这种方法而不能用form提交。
    对于form提交只能用于window.open的形式,其实你可以将窗口模拟做成对话框的样子。楼主好久没有见到过你了:)
      

  6.   

    主要原因在于要传递一个paramKeyWhere,数据库中某个表的主键信息,内容可能较多,可能存在各种特殊字符,直接挂在url可能会出错;最后通过传递window对象,将表单的action和相关参数赋给模态窗口中的一个隐藏表单,将原表单的数据进行提交;谢谢大家的帮助。表单页面
    =======================
    var frmSubmitToModalDialog;//该对象将被模态窗口用到function setTask(operate){
      frmSubmitToModalDialog=document.all(frmName);//frmName是某个form的名字
      frmSubmitToModalDialog.action="/nmbpmp/time/activity/setTask.jsp?paramTableName=<%=strTableName%>&paramLocate="+operate;
      var returnValue=showModalDialog("/comDB/ModalDialog.htm",window,"dialogHeight:500px;dialogWidth:450px;help:no;status:no;scroll:0;center:yes");
      return;
    }
    模态窗口页面
    =======================
    function loadContent(){
      var win=winOpener;
      var frm=win.frmSubmitToModalDialog;
      document.frmHidden.target="iframeContent";
      document.frmHidden.action=frm.action;
      if(frm.paramKeyWhere)document.frmHidden.paramKeyWhere.value=frm.paramKeyWhere.value;
      document.frmHidden.submit();
    }<iframe id=iframeContent name=iframeContent style="scroll:no;" frameborder=0 width=100% height=100% >
    </iframe><div style="display:none">
    <form name=frmHidden target=iframeContent action="">
    <input name=paramTableName>
    <input name=paramKeyWhere>
    </form>
    </div>再次感谢大家的支持。 
    ps:Andrawu(晓彬),一别经月,霜染青丝,郁结衷肠;一朝顿悟,弹指破三界,挥手出五行