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