WMLScript Reference

[Cover] [Previous Section] [Next Section] [Index]

Current chapter: Chapter 8 - Libraries
Section 30 out of 34 total sections , Section 8 out of 9 sections in this chapter


Dialogs Library

The Dialogs library contains a set of typical user-interface functions.

Included in this section are the following function calls:

Function call 

alert 

confirm 

prompt 



alert

dialogs.alert(message)  

Displays the given message to the user, waits for the user confirmation, and returns an empty string ("").


Parameters

message = String


Return Value

String or invalid


Examples

function testValue(textElement) {  
    if (String.length(textElement) > 8) {  
        Dialogs.alert("Enter name < 8 chars!");  
    };  
};  

The example code displays as:



confirm

dialogs.confirm(message, ok, cancel)  

Displays the given message and two reply alternatives: ok and cancel. Waits for the user to select one of the reply alternatives and returns true for ok and false for cancel.


Parameters

message = String

ok = String (text, empty string results in the default implementation-dependent text)

cancel = String (text, empty string results in the default implementation-dependent text)


Return Value

Boolean or invalid


Examples

function onAbort() {  
    return Dialogs.confirm("Are you sure?","Well...","Yes");  
};  

The example code displays as:



prompt

dialogs.prompt(message, defaultInput)  

Displays the given message and prompts for user input. The defaultInput parameter contains the initial content for the user input. Returns the user input.


Parameters

message = String

defaultInput = String


Return Value

String or invalid


Examples

var a = "234-1234";  
var b = Dialogs.prompt("Phone number: ",a);  

The example code displays as:


[Cover] [Previous Section] [Next Section] [Index]


Part Number DKWS-41-002, UP.SDK Release 4.1, December 2000

Copyright © 1994-2000 Openwave Systems Inc. All rights reserved.
Please send comments and questions to sdk-doc-comments@openwave.com.