MaskedTextBox
Kendo UI MaskedTextBox component
Definition
Namespace:Kendo.Mvc.UI
Assembly:Kendo.Mvc.dll
Syntax:
public class MaskedTextBox : WidgetBase, IHtmlAttributesContainer, IFormEditor
Inheritance: objectWidgetBaseMaskedTextBox
Implements:
Inherited Members
Constructors
Initializes a new instance of the MaskedTextBox class.
Properties
Specifies whether the widget will replace the prompt characters with spaces on blur. Prompt chars will be shown again on focus (available since Q2 2014 SP1).
public bool? ClearPromptChar { get; set; }
Sets a value controlling how the color is applied.
public FillMode? FillMode { get; set; }
Specifies the inputmode attribute of the inner <input /> element. It is used to specify the type of on-screen keyboard that should be displayed when the user focuses the input.
public string InputMode { get; set; }
Adds a label before the input. If the input has no id attribute, a generated id will be assigned. The string and the function parameters are setting the inner HTML of the label.
public MaskedTextBoxLabelSettings Label { get; }
Specifies the input mask. The following mask rules are supported: 0 - Digit. Accepts any digit between 0 and 9.; 9 - Digit or space. Accepts any digit between 0 and 9, plus space.; # - Digit or space. Like 9 rule, but allows also (+) and (-) signs.; L - Letter. Restricts input to letters a-z and A-Z. This rule is equivalent to [a-zA-Z] in regular expressions.; ? - Letter or space. Restricts input to letters a-z and A-Z. This rule is equivalent to [a-zA-Z] in regular expressions.; & - Character. Accepts any character. The rule is equivalent to \S in regular expressions.; C - Character or space. Accepts any character. The rule is equivalent to . in regular expressions.; A - Alphanumeric. Accepts letters and digits only.; a - Alphanumeric or space. Accepts letters, digits and space only.; . - Decimal placeholder. The decimal separator will be gotten from the current culture used by Kendo.; , - Thousands placeholder. The display character will be gotten from the current culture used by Kendo. or $ - Currency symbol. The display character will be gotten from the current culture used by Kendo..
public string Mask { get; set; }
The configuration for the prefix adornment of the component.
public MaskedTextBoxPrefixOptionsSettings PrefixOptions { get; }
Specifies the character used to represent the absence of user input in the widget
public string PromptChar { get; set; }
Rules member.
public Dictionary<string, object> Rules { get; }
Sets the size of the component.
public ComponentSize? Size { get; set; }
The configuration for the suffix adornment of the component.
public MaskedTextBoxSuffixOptionsSettings SuffixOptions { get; }
Specifies whether the widget will unmask the input value on form post (available since Q1 2015).
public bool? UnmaskOnPost { get; set; }
Methods
GetElement method.
Serializes the component settings to a dictionary.
public override IDictionary<string, object> Serialize()
A dictionary of settings.
Overrides:
Implements:
SerializeSettings method.
protected override Dictionary<string, object> SerializeSettings()
Overrides:
Writes the HTML content.
protected override void WriteHtml(TextWriter writer)
The text writer.
Overrides:
WriteInitializationScript method.
public override void WriteInitializationScript(TextWriter writer)
Overrides: