Search results

MaskedTextBoxModel

Interface for a class MaskedTextBox

Properties

change

EmitType<MaskChangeEventArgs>

Triggers when the value of the MaskedTextBox changes.

created

EmitType<Object>

Triggers when the MaskedTextBox component is created.

destroyed

EmitType<Object>

Triggers when the MaskedTextBox component is destroyed.

focus

EmitType<MaskFocusEventArgs>

Triggers when the MaskedTextBox while got focus in.

cssClass

string

Gets or sets the CSS classes to root element of the MaskedTextBox which helps to customize the complete UI styles for the MaskedTextBox component.

customCharacters

Object

Sets the collection of values to be mapped for non-mask elements(literals) which have been set in the mask of MaskedTextBox.

  • In the below example, non-mask elements “P” accepts values “P” , “A” , “p” , “a” and “M” accepts values “M”, “m” mentioned in the custom characters collection.

    <input id="mask" type="text" />
    <script>
    var customChar = { P: 'P,A,p,a', M: 'M,m'};
    var maskObj = new MaskedTextBox({ mask: "99 : 99 PM", customCharacters: customChar });
    maskObj.appendTo('#mask');
    </script>

    For more information on customCharacters, refer to customCharacters.

enablePersistence

boolean

Sets a value that enables or disables the persisting state of the MaskedTextBox after reloading the page. If enabled, the ‘value’ state will be persisted.

enableRtl

boolean

Sets a value that enables or disables the RTL mode on the MaskedTextBox. If it is true, MaskedTextBox will display the content in the right to left direction.

enabled

boolean

Sets a value that enables or disables the MaskedTextBox component.

floatLabelType

string

The placeholder acts as a label and floats above the MaskedTextBox based on the below values. Possible values are:

  • Never - The floating label will not be enable when the placeholder is available.
  • Always - The floating label always floats above the MaskedTextBox.
  • Auto - The floating label floats above the MaskedTextBox after focusing it or when enters the value in it.

locale

string

Overrides the global culture and localization value for this component. Default global culture is ‘en-US’.

mask

string

Sets a value that masks the MaskedTextBox to allow/validate the user input.

placeholder

string

Gets or sets the string shown as a hint/placeholder when the MaskedTextBox is empty. It acts as a label and floats above the MaskedTextBox based on the floatLabelType.

promptChar

string

Gets or sets a value that will be shown as a prompting symbol for the masked value. The symbol used to show input positions in the MaskedTextBox. For more information on prompt-character, refer to prompt-character.

showClearButton

boolean

Specifies whether to show or hide the clear icon.

value

string

Gets or sets the value of the MaskedTextBox. It is a raw value of the MaskedTextBox excluding literals and prompt characters. By using getMaskedValue property, you can get the value of MaskedTextBox with the masked format.

<input id="mask" type="text" />
<script>
var maskObj = new MaskedTextBox({ mask: "(999) 9999-999", value: "8674321756" });
maskObj.appendTo('#mask');
</script>

width

number | string

Sets the width of the MaskedTextBox.