ShowmodalDialog: Mode window, a very special window, when it is opened, the activity of the parent window behind will stop. Unless the current mode window is closed, the parent window can be operated. It will use it to implement the form of the form, or make a window similar to the online answer. Its characteristics are that it is very convenient and powerful to pass the parameter. You can directly call the variables and methods of the parent window.
How to use:
vreturnValue = Window.showmodalDialog (Surl [, Varguments] [, Sfeatures]))
Parameter description:
Surl--
Must -choose parameters, type: string. URL used to specify the document to be displayed in the dialog box.
varguments--
Optional parameters, type: variant. Used to pass parameters to the dialog box. The parameter type passed by is not limited, including array, etc. The dialog box obtains parameters passed in through Window.Dialogarguments.
sfeatures--
Optional parameters, type: string. Used to describe the appearance and other information of the dialog box, you can use one or more below, and use the segment ";" to separate.
1.Dialogheight:
The dialog box height, not less than 100px, the default unit of Dialogheight and Dialogwidth in IE4 is EM, and IE5 is PX, which is convenient for the MODAL dialog box to use PX as a unit.
2. Dialogwidth:
Dialogue box width.
3.Dialogleft:
The distance from the left screen.
4.Dialogtop:
Distance from the screen.
5.center: {yes | no | 1 | 0}:
Whether the window is in the middle, the default YES, but the height and width can still be specified.
6.Help: {yes | no | 1 | 0}:
Whether the help button is displayed, the default yes.
7.Resizable: {yes | no | 1 | 0}
[IE5 +]: Whether it can be changed. The default NO.
8.status: {yes | no | 1 | 0}
[IE5+]: Whether to display the status bar. The default is yes [modeless] or no [modal].
9.Scroll: {yes | no | 1 | 0 | 0 | OFF}:
Indicate whether the dialog box displays the rolling bar. The default is yes.
The following attributes are used in HTA and are generally not used in general web pages.
10.DialogHide: {yes | no | 1 | 0 | 0 | OFF}:
Whether the dialog box is hidden when printing or printing preview. The default is NO.
11.edge: {sunken | raised}:
Indicate the border style of the dialog box. The default is raise.
12.unadorned: {yes | no | 1 | 0 | ON | OFF}:
The default is NO.
For exmple:
Parent.html
Copy code code as follows:
<script>
function setname (res) {
document.GetelementByidx_x ("name"). Value = res;
}
function selectp () {
// Pass the setname function of the parent window to the sub -window Window.showmodalog ('Child.html', SetName, 'Dialogwitch: 300px; Dialogheigh: 300px; Center: Yes;) ;;
}
</script>
<input type = "Button" value = "Submit" OnClick = "Selecttp ()"/>/>
<input type = "text" id = "name" name = 'name'/>
child.html
<Script language = "javascript">
<!--
function setname () {
var win = "";
if (Window.Dialogarguments! = NULL)
{{
// Sub -window to get the Setname function of the parent window and operate the assignment
win = window.dialogarguments;
win ('jone');
}
this.close ();
}
//->
</Script>
<input type = "Button" value = "Assign a value to the parent window" onClick = "setname ()"/>