Completed
Last Updated: 26 Jul 2019 08:29 by ADMIN
ADMIN
Telerik Admin
Created on: 03 Jan 2012 12:03
Category: UI for ASP.NET AJAX
Type: Feature Request
11
IMPROVE RadMaskedTextBox with ability to hide/mask certain characters when the input is not in focus
You can hide certain characters using "*" in the DisplayMask. For example: 
Mask="####" 
DisplayMask = "**##"

If the value is "1234", after blur it will look like "**34"
The same approach can be used for all mask parts. The only requirement is DisplayMask to be longer or equal to the Mask. For example:
Mask = "<1..999>someLiterals####SomeMoreLiterals<3..123>"
DisplayMask = "***someLiterals**#*Some*******s<1..99>*"
If in the above example the DisplayMask is shorter or does not contains enough asterisks to match the editable parts, the visible value on blur can be wrong.
2 comments
ADMIN
Peter Milchev
Posted on: 26 Jul 2019 08:29

Hello Manish,

There is no API that would allow the change of the hiding character.

Nevertheless, the attached script overrides the _UpdateDisplayPartsInRange private function and changes the hiding character from '*' to 'X'.

Telerik.Web.UI.RadMaskedTextBox.prototype._UpdateDisplayPartsInRange = function a() { for (var t = 0, a = 0, h = "", s = "", e = 0; e < this._parts.length; e++) this._parts[e].ch || (h += this._parts[e].GetVisValue()); for (; t < this._displayPartIndex.length;) this._displayPartIndex[t].ch ? (a += (this._displayPartIndex[t].ch.match(new RegExp(/X/g)) || []).length, t += this._displayPartIndex[t].ch.length) : (s = h.charAt(a), this._displayPartIndex[t].SetValue(s, t), a++, t++) }

Regards, Peter Milchev
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Attached Files:
Manish
Posted on: 19 Jul 2019 08:38
Can we use 'X' instead of * as hiding character.