This one is simple.
Feel free to replace the regular expression with your own. Mine is very basic.
Ext.apply(Ext.form.field.VTypes, {
password: function(val, field) {
if (/^[a-z0-9]+$/i.test(val)) {
return true;
}
},
passwordText: 'Password may only contain letters and numbers.'
});
Then add vtype: 'password'
to properties of the password textfield:
{
xtype: 'textfield',
...
vtype: 'password',
minLength: 4,
maxLength: 32,
allowBlank: false
...
}
You can see it in action in the demo together with the random password button.
Pingback: Ext.form « Programming Learning