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


Feedback Form (ExpandCollapse)

What do you think about this web page?






(Optional) Please provide us more details. For example, suppose you select option 2 above, can you tell us specifically what information is missing? You can also suggest anything that can help us improve this web page.

(Optional) Your name:

(Optional) Your email address:

Please enter again to confirm:

Due to the amount of messages we received, we may not be able to reply to all messages.

A button for going back to the top of this page