PDA

View Full Version : input text maskRe and max length



hello
8 Apr 2010, 3:08 PM
it seems that the following maskRe doesn't work, the maximum length of 5 doesn't work.

{
xtype: 'textfield',
fieldLabel: 'Zip Code',
allowBlank: false,
maskRe: /\d{0,5}/i,

}

woozy
8 Apr 2010, 4:53 PM
Why dont you use:

{
xtype: 'textfield',
fieldLabel: 'Zip Code',
allowBlank: false,
maxLength: 5
}

woozy
8 Apr 2010, 4:55 PM
And if the input its a number you might prefer use numberfield instead of textfield.