Default TextBox

The Bootstrap Text Box control is a single-line text editor. This example demonstrates the Bootstrap Text Box control with default settings.

@(Html.DevExpress()
    .BootstrapTextBox("TextBoxDefault")
    .Value("Default Text")
)

Null Text

This demo illustrates how the NullText method can be used to display prompt text (watermark) in the editor's edit box. Specified text is displayed when the value of the editor is null and the editor is not focused. The prompt text disappears when the editor receives focus. To show the null text even in the focused editor, call the NullTextDisplayMode method with the UnfocusedAndFocused parameter.

@(Html.DevExpress()
    .BootstrapTextBox("NullTextTextBox")
    .NullText("Enter Your Name")
)

Mask

In this example, the Text Box control takes advantage of the masked input feature to only accept values formatted as phone numbers. You can specify the mask settings using the MaskSettings method:

@(Html.DevExpress()
    .BootstrapTextBox("MaskTextBox")
    .MaskSettings(settings => settings
        .Mask("+1 (999) 000-0000")
        .IncludeLiterals(MaskIncludeLiteralsMode.None)
        .ErrorText("Please input missing digits"))
)

Display Format

The DisplayFormatString method specifies the pattern used to format the value of an editor for display purposes when the editor is not focused. Display values can be formatted using the standard formatting mechanism described in MSDN. For more information about composing format patterns, see the following MSDN topic: Formatting Types.

@(Html.DevExpress()
    .BootstrapTextBox("DisplayFormatTextBox")
    .Value("12345")
    .DisplayFormatString("[ 00 - 00 - 00 ]")
)

Caption and HelpText

In this example, the Text Box control displays a caption on the top and auxiliary help text at the bottom of the editor.

@(Html.DevExpress()
    .BootstrapTextBox("CaptionAndHelpTextTextBox")
    .Caption("First Name")
    .HelpText("Enter your first name")
)
Screen Size
Color Themes
Demo QR Code