home / experts / javascript / column63 |
|
The Dialogs LibraryThis library contains a set of user interface functions, similar to the message boxes of JavaScript.
|
| Syntax | prompt(message, defaultInput) |
| Parameters | message = String, defaultInput = String |
| Returns | String or invalid |
| Examples: | var a = Dialogs.prompt("Enter number of years for computing the mortgage:", "8"); // a = "12" |
confirm()This function displays a given message and waits for the user to select one of the reply alternatives: ok and cancel. Returns true for ok and false for cancel. The ok and cancel strings have implementation-dependent defaults and are programmable by this function.
| Syntax | confirm(message, okMessage, cancelMessage) |
| Parameters | message = String, okMessage = String, cancelMessage = String |
| Returns | Boolean or invalid |
| Examples: | var a = Dialogs.confirm("Delete Entry?", "Yes", "Later"); // a = true ("Yes" is selected) |
alert()This function displays the given message, waits for the user to confirm, and then returns an empty string.
| Syntax | confirm(message) |
| Parameters | message = String |
| Returns | String or invalid |
| Examples: | var a = Dialogs.alert("Number of years for mortgages must be less than 25!"); // a = "" |
Next: A Final Word
Produced by Yehuda Shiran and Tomer Shiran
Created: June 5, 2000
Revised: June 5, 2000
URL: http://www.webreference.com/js/column63/10.html