0

I need to build a mask where some charachters are fixed, like a number where the user have to specify last three digits.

How can I escape the "0" default mask behaviour?

the docs says to use backslash character, but I can't figure out how it should works.

example: my mask needs to show the number 12000___ and user have to enter last 3 digits

html:

<kendo-maskedtextbox [mask]="mask"></kendo-maskedtextbox>

ts:

mask = "12\0\0\0000";

but it doesn't compile...

Doc
  • 5,078
  • 6
  • 52
  • 88

1 Answers1

1

A backslash is a escape character in (JavaScript) strings, thus you need to escape the backslash.

Like this: mask = "12\\0\\0\\0000"

I've also prepared a Plunkr.

Philipp
  • 1,784
  • 1
  • 15
  • 19