spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column90


Modal and Modeless Dialog Boxes

Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

Basic Invocation

When creating a new window, Internet Explorer lets you generate two types of windows. The first type retains the input focus while open. The user cannot switch windows until the window is closed. This behavior is typical to dialog boxes which you need to close before continuing to other tasks. This kind of dialog box is referred to as a modal dialog box. You create a modal dialog box with showModalDialog(). To show the current page, 2.html, in a modal dialog box, you would go:

window.showModalDialog("2.html");

Click the following button to create a modal dialog box:

Try to switch the input focus to another window. See that you cannot. This button is defined as follows:

<INPUT TYPE="button" VALUE="Push To Create"
  onclick="fnOpenModal()">

The function fnOpenModal() is defined as:

function fnOpenModal(){
  window.showModalDialog("2.html")
}

The second type of dialog boxes is referred to as a modeless dialog box. A modeless dialog box allows you to switch the input focus to another window. It continues to display even when you switch to other applications. A modeless dialog box is useful for menus and help systems. It allows the user to use the dialog box and the application window concurrently. You create a modeless dialog box with showModelessDialog(). To show the current page, 2.html, for example, in a modeless dialog box, you would go:

window.showModelessDialog("2.html");

Click the following button to create a modeless dialog box:

Try to switch the input focus to other windows. See that you can do it this time. This button is defined as follows:

<INPUT TYPE="button" VALUE="Push To Create"
  onclick="fnOpenModeless()">

The function fnOpenModeless() is defined as:

function fnOpenModeless(){
  window.showModelessDialog("2.html")
}

Next: How to specify the different arguments when creating dialog boxes

http://www.internet.com

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint


Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: August 13, 2001
Revised: August 13, 2001

URL: http://www.webreference.com/js/column90/2.html