ShowModalDialog parent page, pop-up question, and return value question note

Source: Internet
Author: User

1, the ShowModalDialog function opens the window when the page is submitted to reopen the new page solution


2, return value window.returnvalue problem

If both the parent form and the subform are HTML with JS or jquery directly in the pop-up page window.returnvalue the corresponding value of the parent form is received;

If both the parent form and the subform are. aspx pop-up pages that need to submit data to the server side and refresh the page with a new page reopen problem with 1 resolution, there is a need to rely on the background to return the Window.returnvalue value problem, which requires us to return the following in the background:

Response.Write ("<script type=\" text/javascript\ ">window.close (); window.returnvalue= '" + URL +
"'; if (window.opener) {window.opener.returnvalue= '" + URL + "';} </script> ");

URL is the value we need to return, the parent window is as follows

 var url = ". /videoupload/newuploadbigfile.aspx? Type= "+ t +" &etc= "+ New Date (). GetTime ();
            obj = document.getElementById (o);
            var f = ShowModalDialog (URL, "File Upload", "Dialogwidth=450px;dialogheight=150px;status:no;scroll=no;help:no");
            if (f) {
                 obj.value = f;

Receive, where if (window.opener) {window.opener.returnvalue= ' "+ URL +" ';}, This is because Google Chrome does not support setting up returnvalue directly on the ShowModalDialog pop-up form, as an alternative to setting up window.opener.returnValue in a pop-up window to resolve compatibility issues.

ShowModalDialog parent page, pop-up question, and return value question note

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: 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.