The link and form submission in the web page dialog box will open in a new window.

Source: Internet
Author: User

The link and form submission in the web page dialog box will open in a new window.

Tag: webpage dialog box, Link, form submission, new window, current window, showmodaldialog, showmodelessdialog

environment:
Windows XP SP2, IE6
symptom:
Use window in the script. showmodaldialog () or window. the "webpage dialog box" popped up by showmodelessdialog () contains links or forms. When you click a link or submit a form, the redirected result page is displayed in a new webpage window, it is not displayed in the current "webpage dialog box.
solution:
method 1 (not recommended) first, create a page containing a frame (frame or IFRAME, in the above pop-up dialog box, the Framework page is displayed, and the page to be displayed is displayed in the framework of the Framework page.
disadvantage: The implementation is somewhat complicated. You need to create another framework page. If you only want to make a dialog box like this, it's okay to handle it, but you have to do a lot of it. In this case, there may be many frame pages or only one frame page. The actual page address to be displayed is transmitted to the frame page through the second parameter in the two functions, then, load the actual page to the Framework dynamically using scripts on the Framework page.
when using method 1, pay attention to the returned values of the dialog box. Because the actual page is in the Framework, the returned values must be specified using "window. Parent. returnvalue.
method 2 (recommended !) no framework page is required. You only need to add "" to the label on the page to be displayed in the dialog box ".
after you click a common link or submit a form, the new page is displayed in the current dialog box.
note that both the and

labels have the "target" attribute. If you want to use method 2, you must add " ", and the "target" attribute in and must be null. If you specify the "target" attributes of and that are not empty, the redirected page will not be opened in the current dialog box. I don't know whether this is a problem in my runtime environment or a bug in IE.
In method 2, you can specify "window. returnvalue" for the return value of the dialog box ".

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.