asp.net.ph

Skip Navigation Links

showModalDialog Method

DHTML Methods


Creates a dialog box that displays the HTML document specified in sURL. The dialog box displayed is modal, meaning it retains the input focus until the user closes it.

Syntax

vReturnValue = window.showModalDialog ( sURL 
    [ ,  vArguments ]  [ ,  sFeatures ] ) 
Parameters

sURL Required. String specifying the URL of the document to load and display.
vArguments Optional. Variant specifying the arguments to use when displaying the document. This parameter can be used to pass a value of any type, including an array of values. The dialog can extract the values passed by the caller from the dialogArguments property of the window object.
sFeatures Optional. String specifying the window ornaments for the dialog box. It can be a combination of the following values:

dialogHeight:iHeight Sets the height of the dialog window.
dialogLeft:iXPos Sets the left position of the dialog window relative to the upper-left corner of the desktop.
dialogTop:iYPos Sets the top position of the dialog window relative to the upper-left corner of the desktop.
dialogWidth:iWidth Sets the width of the dialog window.
center:{ yes | no | 1 | 0 } Specifies whether to center the dialog window within the desktop. The default is yes.
help:{ yes | no | 1 | 0 } Specifies whether the dialog should display the context-sensitive Help icon. The default is yes.
resizable:{ yes | no | 1 | 0 } Specifies whether the dialog window will be of set dimensions. The default for both trusted and untrusted dialogs is no.
status:{ yes | no | 1 | 0 } Specifies whether the dialog window will display a status bar. The default is yes for untrusted dialogs and no for trusted dialogs.


Return Value

Variant. Returns the value of the returnValue property as set by the window of the document specified in sURL.

Remarks

Since Microsoft® Internet Explorer® 4.0 it has been possible to eliminate scroll bars on dialogs. To turn off the scroll bar, set the SCROLL attribute to false in the BODY tag for the dialog window or call the modal dialog box from a trusted application.

Internet Explorer® 5 enables further control over modal dialog boxes through the implementation of status and resizable in the sFeatures parameter of the showModalDialog method. Turn off the status bar by calling the dialog box from a trusted application, such as Microsoft Visual Basic® or an HTML Application ( HTA ) , or from a trusted window, such as a trusted modal dialog box. They are considered trusted because each uses Internet Explorer® interfaces instead of the browser. Any dialog generated from a trusted source will have the status bar off by default. Resizing is off by default but can be turned on simply by specifying resizable=yes in the sFeatures string of the showModalDialog method.

The default font settings should be set in the same way CSS attributes are set, for example, "font:3;font-size:4". To define multiple font values, use multiple font attributes.

The default unit of measure for dialogHeight and dialogWidth in Internet Explorer® 4.0 is the em; in Internet Explorer® 5 it is the pixel. For consistent results, specify the dialogHeight, dialogWidth, dialogTop and dialogLeft in pixels when designing modal dialog boxes.

Example

This example demonstrates use of showModalDialog to open a modal window, along with dialogWidth, dialogHeight, dialogTop, and dialogLeft to size and position the window.

 Show me 

Applies To

window



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note