2. WMLScript Dialogs Standard Library Quick Reference

WMLScript's Dialogs standard library contains functions for displaying alert messages, confirmation messages and input boxes to users.



WMLScript Quick Reference: Functions in the Dialogs Standard Library

alert(message)

Displays message on the screen of the mobile device.

Example:

Dialogs.alert("Error: The number you entered is out of range");



Nokia Mobile Browser 4.0



Sony Ericsson T68i

confirm(message, ok, cancel)

Displays message on the screen of the mobile device. If the user selects the option labeled with ok, true is returned. If the user selects the option labeled with cancel, false is returned.

Example:

var isYes = Dialogs.confirm("Do you want to buy this cell phone?", "Yes", "No");



Nokia Mobile Browser 4.0



Sony Ericsson T68i

prompt(title, default_text)

Displays an input field and returns the text entered by the user. title is the title of the input field and default_text is the text used to initialize the input field.

Example:

var textEntered = Dialogs.prompt("How old are you?", "20");



Nokia Mobile Browser 4.0



Sony Ericsson T68i



Previous Page Page 2 of 6 Next Page


A button for going back to the top of this page
OSZAR »