TextBox

The TextBox is a widget that enables a user to enter and edit a single line of text.

Included in: dx.mobile.js, dx.web.js, dx.viz-web.js, dx.all.js
Module: ui/text_box
Export: default
TextBox interactive configuration
Copy Code
Copy to Codepen
$("#textbox").dxTextBox({
});

You can create the widget using one of the following approaches.

  • jQuery

    HTML
    JavaScript
    <div id="textBox"></div>
    $("#textBox").dxTextBox({
        placeholder: "Type a text here..."
    });
  • Angular

    HTML
    <dx-text-box placeholder="Type a text here..."></dx-text-box>
  • AngularJS

    HTML
    <div dx-text-box="{
        placeholder: 'Type a text here...'
    }"></div>
  • Knockout

    HTML
    <div data-bind="dxTextBox: {
        placeholder: 'Type a text here...'
    }"></div>
  • ASP.NET MVC Wrappers

    Razor C#
    Razor VB
    @(Html.DevExtreme().TextBox()
        .ID("textBox")
        .Placeholder("Type a text here...")
    )
    @(Html.DevExtreme().TextBox() _
        .ID("textBox") _
        .Placeholder("Type a text here...")
    )

Note that DevExtreme widgets require you to link the jQuery library to your application. If you use the Knockout or AngularJS approach, the Knockout or AngularJS library is also required. For detailed information on linking these libraries to your project, refer to the topics in the Installation section.

View Demo

See Also
Show Example:
AngularJS
Knockout
jQuery

Configuration

An object defining configuration options for the TextBox widget.

Methods

This section describes members used to manipulate the widget.

Events

This section describes events fired by this widget.