Alert dialog box

From Free net encyclopedia

An alert dialog is a colloquial (though commonly accepted technical) term for a particular type of dialog box that occurs in a graphical user interface. It is also known as an alert box, alert window, or alert popup.

Intended use

Alerts were designed for two main uses. The first is to inform the user than an operation could not continue or complete due to some insurmountable error. The second is to warn them that the current course of action could be in some way dangerous or detrimental, and to offer the option of not proceeding.

Note that this clear and relatively narrow definition has been widely abused, since in most GUI programming, creating and presenting an alert box is very simple.

Misuse

Due to the ease in which a dialog window can be presented to the user, especially in modern web pages using a very simple JavaScript function, alert dialogs are often used for matters that do not reflect a functional error or potentially dangerous course of action, but instead to provide the user with the results of a successful operation, or simply to greet the user with a custom message.

Possibly the most common form of alert abuse is presenting an alert to the user when the user has entered invalid information for one of the values in an input form. Some example of user input errors that might trigger an alert dialog are: entering a date that does not exist (e.g. "February 30"), using letters in a field that should represent a quantity (number), not providing a required value, or providing a value that is outside the range of the program's capabilities (such as from arithmetic overflow). Correctly designed applications should endeavour as far as possible to prevent bad data being entered; an alert should be used as a last resort only. No user should be made to feel like an idiot when the program itself is at fault for allowing malformed entries - alerts are often used by lazy or inexperienced application designers as a "solution" to problems of their own creation.

The typical alert dialog provides only one option; to close the window. Closing an alert dialog will provide access to the original screen, where the user can make changes to the input values to alleviate the dialog's warnings. Such alerts are redundant and unnecessary, and do not enhance usability. However, sadly such abuses are extremely widespread.

Example

alert() is the name of the method used in JavaScript to spawn an alert dialog. The argument to the method is the text to be displayed in the window.

A dialog created this way will contain a yellow triangle warning symbol (similar to those found on electrical devices), the text of the warning message, and a single button saying "OK" which will close the window.

Such a dialog also assumes control over the user interface, preventing the user from proceeding with any other task in the application until the dialog window is closed.

Used along with a technique to execute it in a web page, the following JavaScript code:

alert('This alert dialog tells you something important.');

will create the following alert dialog (when viewed with Mozilla running on Windows XP):

Image:JavaScript Alert Dialog.PNG