WMLScript Standard Libraries: The Dialogs Library | WebReference

WMLScript Standard Libraries: The Dialogs Library


WMLScript Standard Libraries

The Dialogs Library

This library contains a set of user interface functions, similar to the message boxes of JavaScript.

prompt()

This function displays a given message and prompts for an input. A default input is also specified as the second parameter. Returns the user input.

Syntaxprompt(message, defaultInput)
Parametersmessage = String, defaultInput = String
ReturnsString 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.

Syntaxconfirm(message, okMessage, cancelMessage)
Parametersmessage = String, okMessage = String, cancelMessage = String
ReturnsBoolean 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.

Syntaxconfirm(message)
Parametersmessage = String
ReturnsString or invalid
Examples:var a = Dialogs.alert("Number of years for mortgages must be less than 25!"); // a = ""

Next: A Final Word

http://www.internet.com

Produced by Yehuda Shiran and Tomer Shiran

Created: June 5, 2000
Revised: June 5, 2000

URL: http://www.webreference.com/js/column63/10.html