www.fgks.org   »   [go: up one dir, main page]

Click to Rate and Give Feedback
Properties
 dialogArguments Property
dialogArguments Property

Gets the variable or array of variables passed into the modal dialog window.

Syntax

[ vVariables = ] window.dialogArguments

Possible Values

vVariables A string, numeric, object, or array value that specifies arguments.

The property is read-only. The property has no default value.

Remarks

The dialogArguments property applies only to windows created using the showModalDialog method and the showModelessDialog method.

Examples

The following example shows how to get information passed into a modal dialog window by using the dialogArguments property. The code corresponds to two different files. One file launches the modal window and the other file stores the code for the modal window.

This file launches the modal window and then sends an object to that modal window.

<HTML>
<HEAD>
<SCRIPT>
function fnLaunch()
{
    var aForm;
    aForm = oForm.elements;
    var myObject = new Object();
    myObject.firstName = aForm.oFirstName.value;
    myObject.lastName = aForm.oLastName.value;
	// The object "myObject" is sent to the modal window.
    window.showModalDialog("modalDialogSource.htm", myObject, "dialogHeight:300px; dialogLeft:200px;"); 
}
</SCRIPT>
</HEAD>
<BODY>
<BUTTON  >Launch The Window</BUTTON>
<FORM ID= "oForm">
First Name:
<INPUT TYPE="text" NAME="oFirstName" VALUE="Jane">
<BR>
Last Name:
<INPUT TYPE="text" NAME="oLastName" VALUE="Smith">
</FORM>
</BODY>
</HTML>

This file (modalDialogSource.htm), stores the code for the modal window. Get the object sent to this modal window by using the dialogArguments property.

<HTML>
<HEAD>
<SCRIPT>
var oMyObject = window.dialogArguments;
var sFirstName = oMyObject.firstName;
var sLastName = oMyObject.lastName;
</SCRIPT>
	<title>Untitled</title>
</head>
<BODY STYLE="font-family: arial; font-size: 14pt; color: Snow; 
background-color: RosyBrown;">

First Name:
<SPAN STYLE="color:00ff7f">
<SCRIPT>
document.write(sFirstName);
</SCRIPT>
</SPAN>
<BR>
Last Name:
<SPAN STYLE="color:00ff7f">
<SCRIPT>
document.write(sLastName);
</SCRIPT>
</SPAN>
</BODY>
</HTML>
This feature requires Microsoft® Internet Explorer 4.0 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

Standards Information

There is no public standard that applies to this property.

Applies To

window
Tags What's this?: Add a tag
Community Content
 
Add Community Content
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker
DCSIMG