用window.showModalDialog彈出添加更新表單,提交重新整理父表單。

來源:互聯網
上載者:User

今天用window.showModalDialog彈出新表單,做添加時,要關閉子表單重新整理父表單,但是在網上找了很久用reload()方法都沒有實現,或者就是iframe表單彈出的子表單會有一個提示提示是否從新發送,如果這樣會給使用者一個很不好的體驗。後來就用了另外一個方法。具體方法如下:

a.html

function showModal(){

window.showModalDialog("url");彈出一個新表單,

setTimeout('document.loadRefresh.submit()',300);//我用這個函數來關閉新表單調用loadRefresh表單提交

}

<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>
<form name="loadRefresh" action="task!detail.action" method="get">
<input type="hidden" name="id" value="<s:property value='task.taskId'/>"/>
</form>

b.html

/**

*表單提交函數,提交後關閉。

*/

function taskSubmit(){

document.getElementById("processTask").submit();
window.close();

}

通過以上方法就能夠完成關閉子視窗重新整理父視窗。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.