WMLScript prompt() Function

The prompt() function displays a message and waits for input. The second parameter is the default input value, and if the user does not enter a value, this value will be returned. The function returns the user's input value or the default value.

Syntax

n = Dialogs.prompt(message, defaultinput)
Component Description
n String returned from this function.
message String containing message (question).
defaultinput String containing default input (answer).

Example

var a = Dialogs.prompt("Enter a number:","3");

Result

a = "5" (if the user entered the value 5)
a = "3" (if the user did not enter a value)