value
Gets or sets the value of the MaskedTextBox.
Important: This method does not trigger the
focusout
event of the input. This can affect the floating label functionality. To overcome this behavior, manually invoke therefresh
method of the Floating Label:$("#maskedtextbox").data("kendoMaskedTextBox").floatingLabel.refresh();
Parameters
value String
The value to set.
Returns
String
The value of the widget.
Example - get the value of the MaskedTextBox
<input id="maskedtextbox" />
<script>
$("#maskedtextbox").kendoMaskedTextBox({
mask: "000000",
value: "123456"
});
var maskedtextbox = $("#maskedtextbox").data("kendoMaskedTextBox");
var value = maskedtextbox.value();
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(value);
</script>
Example - set the value of the MaskedTextBox
<input id="maskedtextbox" />
<script>
$("#maskedtextbox").kendoMaskedTextBox({
mask: "(000) 000-0000"
});
var maskedtextbox = $("#maskedtextbox").data("kendoMaskedTextBox");
var value = maskedtextbox.value();
maskedtextbox.value("555 123 1234");
</script>