I had a look at the Dojo Demo and made some changes to have prefix to the maskedtext. But on the first load if there are no match to the masked Text in this example an empty string , the prefix does not appear until unless clicked on the input. This causes a problem because the input should have the prefix regardless of any event occurring on it., and not null
Is there any way I can have the input populated with the prefix on load if the value has no match in masked text.
http://dojo.telerik.com/UbiWAPAV/2
<input id=
"masked"
/>
<script>
$(
function
() {
var
masked = $(
"#masked"
).kendoMaskedTextBox({
mask:
"S\\AAA-AAA"
}).data(
"kendoMaskedTextBox"
);
if
(!$(
"#masked"
).val()){
$(
"#masked"
).val(masked._emptyMask);
}
});
</script>
HI Alex,
Thanks for getting back. Having the masked text appear on focus and blur would be a good feature to have. Please go ahead and convert this ticket to a public feature request.
However the 2 solutions you provided assumes that we already know what the mask text format is or a predefined placeholder text. Is there a way to extract a mask text from the maskedtextbox control?
Thanks
if
(!$(
"#masked"
).val()){
$(
"#masked"
).val(
"SA__-___"
);
}