spacer

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

home / experts / javascript / column90


Modal and Modeless Dialog Boxes

Developer News
Google Chrome Playing Catch-Up on Extensions
Open Solutions Alliance Gets New Leadership
Red Hat Spacewalk Expands Linux Management

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.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

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

webref The latest from WebReference.com Browse >
Popular JavaScript Framework Libraries: An Overview - Part 3 · Accessing Your MySQL Database from the Web with PHP · Working with the DOM Stylesheets Collection
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
MS Access and MySQL · Cisco AutoQoS: VoIP QoS for Mere Mortals · While VoIP Adoption Explodes in Enterprise, Carrier Spending Lags


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