Alert dialog box
From Wikipedia, the free encyclopedia
An alert dialog is a colloquial (though commonly accepted) 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.
The typical alert dialog provides information in a separate box to the user, after which the user can only respond in one way: by closing it. Closing an alert dialog will provide access to the original window, which is not available while the alert dialog is presented.
[edit] 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.
Due to the simplicity of generating an alert box, especially in comparison with other popup methods, alert boxes are often heavily used in amateur web applications for providing information and notifications that are not the result of errors or failures.
[edit] 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).
Solutions that are considered better user interface design include changing a visual aspect of the input element to reflect an invalid entry (such as applying a red border), or adding a character such as an asterisk next to the input element that needs to be corrected.
[edit] 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):