PDA

View Full Version : reg exp quesiton



marcollo
20 May 2009, 6:34 AM
I'm creating a form like:

new Ext.FormPanel({
labelWidth: 75, // label settings here cascade unless overridden
url:'save-form.php',
frame:true,
title: 'Inserisci Nuova notecard',
bodyStyle:'padding:5px 5px 0',
width: 350,
defaults: {width: 230},
defaultType: 'textfield',

items: [
{
fieldLabel: 'First Name',
name: 'first',
}, {
fieldLabel: 'Last Name',
name: 'last',
}, {
fieldLabel: 'Company',
name: 'company',
}, {
fieldLabel: 'Email',
name: 'email',
vtype:'email',
},
{
fieldLabel: 'Scadenza',
name: 'scadenza',
numText: 'Insert only 6 characters',
// vtype Mask property: The keystroke filter mask
maskRe:/[a-z]{6}/,
},


],.......

if I insert only /[a-z]/ works, the fileld accepts only characters a to z!
but [a-z]{6} do not work and the fileld seems disable and dosen't accepts any character!

Is there another way to specify only 6 characters after the exp [a-z]????

TY

Animal
20 May 2009, 6:38 AM
That means that the character typed must instantly be 6 characters long.

Animal
20 May 2009, 6:41 AM
http://extjs.com/deploy/ext-3.0-rc1.1/docs/?class=Ext.form.TextField&member=regex ?