prompt

Opens a Kendo UI Prompt popup. Similar to the native window.prompt() method.

Example - Open a Kendo UI Prompt on the page

<script>
    kendo.prompt("Prompt text", "Default input text");
</script>

Parameters

text String

The text to be shown in the Prompt popup.

Parameters

defaultValue String

The default value that will be shown in the popup's input.

Returns

Promise a jQuery promise instance, which can be used for callbacks, or passed to jQuery.when. The jQuery Deferred object resolves to:

  • done() - when user has pressed the "OK" button and the data passed to the callback is the inputted text;
  • fail() - when user has pressed the "Cancel" button and the data passed to the callback is the inputted text.

Example

<script>
    kendo.prompt("Prompt text", "Default input text")
        .done(function(data){
/* The result can be observed in the DevTools(F12) console of the browser. */
            console.log("User accepted with text: " + data);
        })
        .fail(function(data){
/* The result can be observed in the DevTools(F12) console of the browser. */
            console.log("User rejected with text: " + data);
        });
</script>
In this article