Change Theme Settings
Change Theme Settings
Show All Themes

Text Box

DisplayFormatString = "[ 00 - 00 - 00 ]"
NullText = "Enter your name..."
MaskSettings.Mask = "+1 (999) 000-0000"
[Mask("+1 (999) 000-0000")]

This demo illustrates the primary features of the DevExpress MVC Text Box - a single-line text input editor.

The text displayed in the edit box can be specified via the Text property. The Properties.DisplayFormatString property specifies the pattern used to format an editor's value for display purposes when not focused.

The Text Box editor supports masked input - mask settings can be accessed via the Properties.MaskSettings property. A mask expression can be specified via MaskSettings.Mask.

In addition to editor's mask settings, it is possible to define the mask settings for a model field using the DevExpress Mask attribute. The mask pattern will automatically be displayed within the TextBox extension. The Mask attribute enables the validation mechanism that checks whether the entered value matches the mask expression. The decorated model field will be automatically validated on the server side.