What is a dialog box used for?


JavaScript supports three important types of dialog boxes. These dialog boxes can be used to raise and alert, or to get confirmation on any input or to have a kind of input from the users. Here we will discuss each dialog box one by one.

Alert Dialog Box

An alert dialog box is mostly used to give a warning message to the users. For example, if one input field requires to enter some text but the user does not provide any input, then as a part of validation, you can use an alert box to give a warning message.

Nonetheless, an alert box can still be used for friendlier messages. Alert box gives only one button "OK" to select and proceed.

Example


      
           
   
   
   
      

Click the following button to see the result:

Output

Confirmation Dialog Box

A confirmation dialog box is mostly used to take user's consent on any option. It displays a dialog box with two buttons: OK and Cancel.

If the user clicks on the OK button, the window method confirm() will return true. If the user clicks on the Cancel button, then confirm() returns false. You can use a confirmation dialog box as follows.

Example


      
           
   
   
   
      

Click the following button to see the result:

Output

Prompt Dialog Box

The prompt dialog box is very useful when you want to pop-up a text box to get user input. Thus, it enables you to interact with the user. The user needs to fill in the field and then click OK.

This dialog box is displayed using a method called prompt() which takes two parameters: (i) a label which you want to display in the text box and (ii) a default string to display in the text box.

This dialog box has two buttons: OK and Cancel. If the user clicks the OK button, the window method prompt() will return the entered value from the text box. If the user clicks the Cancel button, the window method prompt() returns null.

Example

The following example shows how to use a prompt dialog box −


        
            
   
   
   
      

Click the following button to see the result:

Output

Lesson 5: Dialog Boxes

/en/office2000basics/toolbars/content/

Introduction

By the end of this lesson, you should be able to:

  • Discuss dialog boxes common to Office 2000 applications
  • Identify a wizard

Dialog boxes

The key components of Office 2000 are Word, Excel, PowerPoint, and Access. We will focus on these four applications throughout the Office 2000 skill sets.

Dialog boxes are special windows that let you control how an application works or how it looks on the screen. Dialog boxes look a lot like other windows.

However, dialog boxes contain controls that are used to change the function or appearance of an application.

While exploring Office 2000's menus, you may have noticed that there is an ellipsis (…) next to some menu commands. This means if you select that command, a dialog box will appear.

Dialog boxes can contain the following types of controls:

  • Command buttons
  • Option buttons
  • Check boxes
  • Text boxes
  • Drop-down list boxes
  • Spin boxes
  • List boxes
  • Tabs
  • Sliders

Dialog boxes in detail

What is a dialog box used for?

Command buttons

A command button, such as OK or Cancel, tells the computer to carry out an action. Execute a command by clicking a command button.

Options buttons

Option buttons appear when you are shown a list of choices and you need to select only one option. To select an option, click inside the circle next to your choice. When selecting an option, a small black dot fills the circle.

Check boxes

Check boxes appear when selecting more than one option. To select an option, click inside the box. When selecting an option, a check mark appears in the box.

Text boxes

A text box provides space to type information. For example, when naming a file you type the name into a text box.

Spin boxes

A spin box is used to set a value, such as the number of copies to print. To increase or decrease the number, you click the up and down arrows.

List boxes

A list box usually is a large white space that contains a list of options. If the list of options is too long to fit inside the list box, a vertical scroll bar will let you move up and down the list.

What is a dialog box used for?

Drop-down list boxes

Drop-down list boxes are similar to the list boxes just described. However, drop-down list boxes show only one option at a time (the option that is selected), and there is an arrow at the end of the box. To see the entire list of options, click the arrow, and the list of options appears.

Sliders

A slider looks like a sliding volume control on a radio. A slider sets a value within a continuous range of values, such as from slow to fast. To move a slider, place the mouse pointer on the slider, left-click, then drag it from side to side.

Tabs

Tabs look like the tabs on file folders that allow you to read what's on the label of each folder. Tabs let you switch between pages of information. When you click on a tab, a page of information appears.

What is a wizard?

A wizard is simply a short series of dialog boxes that guides you through more enhanced processes in Office 2000. With the help of a wizard, some of these processes are just a matter of a few short steps.

If you know how to operate a dialog box, then you should have no problem using wizards in Office 2000. Types of wizards in Office 2000 include:

  • AutoContent
  • Chart
  • Contact Management database
  • Database
  • Form
  • Office Assistant
  • Pack and Go
  • Report
  • Simple query
  • Table
  • Webpage

Example of the Chart Wizard in Excel

What is a dialog box used for?

What is a dialog box used for?

What is a dialog box used for?

What is a dialog box used for?

What is a dialog box used for?

Challenge!

  • Open an existing file.
  • Go to File
    What is a dialog box used for?
    Print. The Print dialog box will open.
  • Explore some of the options in the Print dialog box.
  • Click OK to print the file. If you don't want to print it, click Cancel.

/en/office2000basics/new-file/content/

What are the 3 types of dialogue boxes?

There are 3 types of dialog boxes: modeless, modal, and system modal. Modal dialog boxes are generally used inside a program, to display messages, and to set program parameters.

What features does a dialogue box offer?

The dialog box (also called dialogue box (non-U.S. English) or simply dialog) is a graphical control element in the form of a small window that communicates information to the user and prompts them for a response.

What are the 2 types of dialog boxes?

All common dialog boxes are modal, except the Find and Replace dialog boxes. Modal dialog boxes must be closed by the user before the function used to create the dialog box can return. The Find and Replace dialog boxes are modeless; the function returns before the dialog box closes.