WMLScript » Dialogs » Dialogs.confirm

Syntax:
Dialogs.confirm(message, okmessage, cancelmessage)
message
The mandatory message parameter is a string or text that provides a useful message to the user concerning the possible choices.
okmessage
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.
cancelmessage
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.

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.

Examples

Code:
<?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>
Explanation:

Code for ConfirmExample.wml

Language(s): WML
Code:
extern function displayconfirm()
{
   var result = Dialogs.confirm("Continue?", "Yes", "No");
   if(result == true)
   {
      WMLBrowser.go("ConfirmExample.wml#card2");
   }
   else
   {
      WMLBrowser.go("ConfirmExample.wml#card3");
   }
};
Explanation:

Code for ConfirmExample.wmls.

Language(s): WML

See Also: