Refresh the data in the parent window after the submission mode window

Source: Internet
Author: User

Some time, design as needed. In a window, click the button to bring up the mode window. In the mode window, after adding data (submit), close the mode window and refresh the parent window, the window in the exact mode does not support windows. therefore, the parent window cannot be obtained. That is to say, the parent window cannot be obtained after the mode window is closed. However, you can use the return value of showmodealdialog to determine whether to refresh the window. When showmodealdialog is called, the parent windowCodeIt will stop in this row. When the pop-up mode window is closed, it will be given to window. returnvalue value assignment, and then call window. close () method, and finally submit. After the data is submitted, the mode window is closed.ProgramReturn to the parent window. showmodealdialog returns the returned value. Next, you can determine whether to reload the returned value. Note: to avoid opening a new window, you must add <base target = "_ Self"/> under

 

code 1: parent form </P> <p> function showdatas () {</P> <p> var Re = Window. showmodaldialog ("url", "parameter", "Description"); </P> <p> If (RE = 1) {</P> <p> window. location. reload (); </P> <p >}</P> <p> Code 2: modal form </P> <p> function subform () {</P> <p> window. returnvalue = "1"; </P> <p> window. close (); </P> <p> document. getelementbyid ("myform "). submit (); </P> <p >}</P> <p>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.