New to Kendo UI for jQuery? Start a free 30-day trial

Value

methods

Gets or sets the value of the PromptBox.

Parameters:valueString

The value to set. If omitted, the method returns the current value.

Returns:String

The value of the PromptBox when called without parameters.

<div id="promptbox"></div>
<button id="get-value">Get Value</button>
<script>
var promptbox = $("#promptbox").kendoPromptBox({
    value: "Hello world",
    placeholder: "Type something..."
}).data("kendoPromptBox");

$("#get-value").click(function() {
    alert("Current value: " + promptbox.value());
});
</script>
<div id="promptbox"></div>
<button id="set-value">Set Value</button>
<script>
var promptbox = $("#promptbox").kendoPromptBox({
    placeholder: "Will be updated..."
}).data("kendoPromptBox");

$("#set-value").click(function() {
    promptbox.value("New value set programmatically");
});
</script>
Not finding the help you need?
Contact Support