module Ext_form_field_Text:A basic text field. Can be used as a direct repla ...sig
..end
A basic text field. Can be used as a direct replacement for traditional text inputs, or as the base class for more sophisticated input controls (like Ext.form.field.TextArea and Ext.form.field.ComboBox). Has support for empty-field placeholder values (see emptyText).
The Text field has a useful set of validations built in:
maxlength
attribute on the input element)In addition, custom validations may be added:
The details around how and when each of these validation options get used are described in the documentation for getErrors.
By default, the field value is checked for validity immediately while the user is typing in the field. This can be controlled with the validateOnChange, checkChangeEvents, and checkChangeBuffer configurations. Also see the details on Form Validation in the Ext.form.Panel class documentation.
Text fields can be configured with custom regular expressions to be applied to entered values before validation: see maskRe and stripCharsRe for details.
Ext.create('Ext.form.Panel', {
title: 'Contact Info',
width: 300,
bodyPadding: 10,
renderTo: Ext.getBody(),
items: [{
xtype: 'textfield',
name: 'name',
fieldLabel: 'Name',
allowBlank: false // requires a non-empty value
}, {
xtype: 'textfield',
name: 'email',
fieldLabel: 'Email Address',
vtype: 'email' // requires value to be a valid email address format
}]
});
class type t =object
..end
class type configs =object
..end
class type events =object
..end
class type statics =object
..end
val of_configs : configs Js.t -> t Js.t
of_configs c
casts a config object c
to an instance of class t
val to_configs : t Js.t -> configs Js.t
to_configs o
casts instance o
of class t
to a config object