Method to modify mask in MaskedTextbox
Hi,
This functionality can be achieved via the setOptions method:
<input id="phone_number" />
<button id="changeMaskBtn" class="k-button">Change mask</button>
<script>
$(document).ready(function() {
$("#phone_number").kendoMaskedTextBox({
mask: "(999) 000-0000"
});
$("#changeMaskBtn").on("click", function() {
var maskedTextBox = $("#phone_number").getKendoMaskedTextBox();
maskedTextBox.setOptions({
mask: "0000 0000 0000 0000"
});
});
});
</script>
The approach is illustrated in the following example:
https://dojo.telerik.com/ovibELoJ/2
Regards,
Viktor Tachev
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.