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
TextBox interactive configuration
Copy Code
Copy to Codepen
$("#textbox").dxTextBox({
});

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

  • jQuery
    Use the dxTextBox jQuery plug-in.

    HTML
    <div id="textBox"></div>
    JavaScript
    $("#textBox").dxTextBox({
        placeholder: 'Type password',
        maxLength: 10,
        mode: 'password'
    });
  • Knockout
    Add a div element and apply the dxTextBox binding to this element.

    HTML
    <div data-bind="dxTextBox: {
        placeholder: 'Type password',
        maxLength: 10,
        mode: 'password'
    }"></div>
  • AngularJS
    Add a div element and apply the dx-text-box directive to this element.

    HTML
    <div dx-text-box="{
        placeholder: 'Type password',
        maxLength: 10,
        mode: 'password'
    }"></div>

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

You can find detailed information on the principles of working with the widget in the dxTextBox section of the Editor Widgets article.

View Demo

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.