Another more complex type of validation is the vtype
. This can be used to validate and restrict user input, and report back error messages. It will work in just about any scenario you can imagine because it uses regular expressions to do the grunt work.
Here are some built-in vTypes
that can come in handy:
- url
- alpha
- alphanum
These built-in vtypes
are intended to be simplistic, and mostly used as a starting point for creating your own vtypes
.
Here is an alpha vtype
being used with a QuickTips
balloon error message:
Ext.onReady(function(){
var movie_form = new Ext.FormPanel({
url: 'movie-form-submit.php',
renderTo: document.body,
frame: true,
title: 'Movie Information Form',
width: 250,
items: [{
xtype: 'textfield',
fieldLabel: 'Title',
name: 'title',
allowBlank: false
},{
xtype: 'textfield',
fieldLabel: 'Director',
name: 'director',
vtype: 'alpha'
},{
xtype: 'datefield...