Default Text Box

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

    .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 argument.

    .NullText("Enter Your Name")


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:

    .MaskSettings(settings => settings
        .Mask("+1 (999) 000-0000")
        .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.

    .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.

    .Caption("First Name")
    .HelpText("Enter your first name")
Screen Size
Color Themes
Demo QR Code