Displays a message, called a prompt, that requires the user to input a value.
The
Dialogs.prompt function displays a text message and a default
input value, and requires that the user accept the default input or
enter a different value. The displayed message is said to prompt the
user for an input.
The input value is returned
by this function.
<?xml
version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD
WML 1.1//EN" "http://www.WAPforum.org/DTD/wml_1.1.xml">
<wml>
<card
id="card1">
<p>
prompt
example
</p>
<do
type="accept">
<go
href="PromptExample.wmls#displayprompt()" />
</do>
</card>
<card id="card2">
<p>
Amount =
$amount
</p>
</card>
</wml>
Code for PromptExample.wml
extern function displayprompt()
{
var mydefault = "71";
var result = Dialogs.prompt("Enter amount", mydefault);
WMLBrowser.setVar("amount", result);
WMLBrowser.go("PromptExample.wml#card2");
};
Code for PromptExample.wmls