Search
InputDialog Constructor
See Also
 






Initializes a new instance of the InputDialog class.

Namespace: MindFusion.Common.UI
File: InputDialog.js

 Syntax

JavaScript  Copy Code

function InputDialog ([title, [message, [parent, [input, [property]]]]])

 Parameters

title
Optional.

String. The text to display as a dialog title.

message
Optional.

String. The message to display as the dialog text.

parent
Optional.

HTMLElement. The Dom element to append the dialog to.If the parameter is not specified, the dialog will be appended to document.body.

input
Optional.

HTMLElement. The input control to show in the dialog. If the parameter is not specified, an empty HTML text input will be displayed.

property
Optional.

String. The name of the property of the input control, whose value will be passed as the second argument to the callback function.If the parameter is not specified, the value property will be used.

 Example

The following code creates a new instance of the InputDialog class:

JavaScript  Copy Code

// create a custom input for the input dialog
var select = document.createElement("select");

var option = document.createElement("option");
option.value = 0;
option.innerHTML = "Relaxed";
select.appendChild(option);

option = document.createElement("option");
option.value = 1;
option.innerHTML = "Timed";
select.appendChild(option);

// show the dialog
ui.Dialogs.showInputDialog("", "Choose game mode", startGame, document.getElementById("content"), select, "value");


function startGame(result, mode)
{
 if (result == ui.ModalResult.Cancel) return;
        ...........
        ...........
}

 See Also