The Dialogs library contains a set of typical user-interface functions.
Included in this section are the following function calls:
dialogs.alert(message)
Displays the given message to the user, waits for the user confirmation, and returns an empty string ("").
message = String
String or invalid
function testValue(textElement) {
if (String.length(textElement) > 8) {
Dialogs.alert("Enter name < 8 chars!");
};
};
The example code displays as:
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.
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)
Boolean or invalid
function onAbort() {
return Dialogs.confirm("Are you sure?","Well...","Yes");
};
The example code displays as:
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.
message = String
defaultInput = String
String or invalid
var a = "234-1234";
var b = Dialogs.prompt("Phone number: ",a);
The example code displays as: