The simplest use of Ext.form.TextField

Source: Internet
Author: User
Tags regular expression

var textfieldname = new Ext.form.TextField

({

ID: "Textfieldname",

allowblank:false,//default is True, if it is false, NULL is not allowed

If not NULL, the default hint message for the definition of the hint message is: the This field is required

To make the prompt appear, you need to add Ext.QuickTips.init ();

Blanktext: "Please enter data",

disabled:false,//default is False

Emptytext: "Please enter data correctly",//default is NULL

Fieldlabel: "User name",//default is ""

Height: "Auto",//default is auto

hidden:false,//default is False

hidelabel:false,//default is False

Hidemode: "Offsets",//default display, you can take value: display,offsets,visibility

InputType: "Text",//input type This is very important, can be radio, text, password, file default is text

InvalidText: "InvalidText: can only enter a number",//default is: The value in the field is invalid

maxlength:100,//the maximum length of content that can be entered

Maxlengthtext: "Input too long",//exceeding the maximum length of setup information

minlength:2,//the minimum length of content that can be entered

Maxlengthtext: "The input is too short",//does not reach the minimum length of the setup information

readonly:false,//content is read-only, default false

regex:/^d$/,//Regular expressions Here assume that only numbers are allowed. If you enter a number, the following definition of the hint message appears

Regextext: "Regextext: can only enter a number",//define a message that does not conform to regular expressions

validateonblur:true,//is true by default, validation when lost focus

validationdelay:300,//default is 250, verify the latency, the number of milliseconds

Validationevent: "Click",//validation event default is KeyUp can be String/boolean

Custom validation functions Execute this function when the data entered does not conform to the requirements of the regular expression

Validator:function () {Ext.Msg.alert ("hint info", "can only enter a number");

Value: "",//custom information By default is: undefined

X:number,y:number, x,y coordinates in the container

Width: "Auto",//default is auto

Renderto: "Bind_textfield"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.