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({
});

                    

DevExtreme widgets are integrated with many popular libraries and frameworks. See the Installation section (for JavaScript libraries) or the Prerequisites and Installation section (for ASP.NET MVC framework) to find details on setting up DevExtreme with a particular library or framework.

The following code shows how to create the TextBox widget using every supported library and framework. For more details on working with widgets in these libraries and frameworks, see the Widget Basics topic for jQuery, Angular, AngularJS, Knockout or ASP.NET MVC.

jQuery
JavaScript
HTML
$("#textBox").dxTextBox({
    placeholder: "Type a text here..."
});
<div id="textBox"></div>
Angular
HTML
TypeScript
<dx-text-box placeholder="Type a text here..."></dx-text-box>
import { DxTextBoxModule } from 'devextreme-angular'
// ...
export class AppComponent {
    // ...
}
@NgModule({
    imports: [
        // ...
        DxTextBoxModule
    ],
    // ...
})
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 Controls
Razor C#
Razor VB
@(Html.DevExtreme().TextBox()
    .ID("textBox")
    .Placeholder("Type a text here...")
)
@(Html.DevExtreme().TextBox() _
    .ID("textBox") _
    .Placeholder("Type a text here...")
)

View Demo

See Also
Show Example:
AngularJS
Knockout
jQuery

Configuration

An object defining configuration options for the TextBox widget.

Methods

This section describes the members used to manipulate the widget.

Events

This section describes events fired by this widget.

See Also