FUNCTION: Dialogs.confirm
Dialogs.confirm(message,
okmessage, cancelmessage)
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.
The mandatory message parameter is a string or text that provides
a useful message to the user concerning the possible choices.
The mandatory okmessage parameter is a string or text that the
user must select if the response to the confirmation is ok. If
this choice is selected, a value of true is returned.
The mandatory cancelmessage parameter is a string or text that
the user must select if the response to the confirmation is to cancel.
If this choice is selected, a value of false is returned.
Code for ConfirmExample.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>
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.wmls
extern function displayconfirm()
{
var result = Dialogs.confirm("Continue?",
"Yes", "No");
if(result == true)
{
WMLBrowser.go("ConfirmExample.wml#card2");
}
else
{
WMLBrowser.go("ConfirmExample.wml#card3");
}
};
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information
|