Displays a message, called a confirmation, that requires the user to make a choice.
The Dialogs.confirm function displays a text message and requires the user to respond by selecting one of two possible alternatives responces, either ok or cancel. This message is referred to as a confirmation.
<?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>
confirm
example
</p>
<do
type="accept">
<go
href="ConfirmExample.wmls#displayconfirm()" />
</do>
</card>
<card id="card2">
<p>
Confirm
is true
</p>
</card>
<card id="card3">
<p>
Confirm
is false
</p>
</card>
</wml>
Code for ConfirmExample.wml
extern function displayconfirm()
{
var result = Dialogs.confirm("Continue?", "Yes", "No");
if(result == true)
{
WMLBrowser.go("ConfirmExample.wml#card2");
}
else
{
WMLBrowser.go("ConfirmExample.wml#card3");
}
};
Code for ConfirmExample.wmls.