Dialogs.alert
Dialogs.confirm
FUNCTION: Dialogs.prompt
Dialogs.prompt
(message, defaultinput)
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.
The mandatory
message
parameter is a string or text that requests an input from the user.
The mandatory
defaultinput
parameter can be either a variable or a string value that will be displayed as the default input. You can use the empty string "" if you do not wish to display a default input.
Code for PromptExample.wml
<?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.wmls
extern function displayprompt()
{
var mydefault = "71";
var result =
Dialogs.prompt("Enter amount", mydefault)
;
WMLBrowser.setVar("amount", result);
WMLBrowser.go("PromptExample.wml#card2");
};
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information