PDA

View Full Version : can we have 2vtypes on the same textfield



vipuljaveri
26 Nov 2010, 1:41 AM
hii....
I have a registration form in which there is a text field for url input...
I even have the vtype url for the same but now i want that the user should only input the url which doesnt exist in the DB...
this is my code
{
xtype : 'textfield',
fieldLabel : '<font color=#15428B><b>Company URL</b></font><font color=red>*</font>',
id : 'cmpURL',
name : 'companyURL',
vtype : 'url',
validationEvent : '',
allowBlank : false,
width : 170,
}

now i even want to check where the user is inputing unique url(Which doesnt have entries in my DB)...
plz reply

mitchellsimoens
26 Nov 2010, 6:47 AM
You have will have to create your own vtype.

Look at the API docs here (http://dev.sencha.com/deploy/dev/docs/?class=Ext.form.VTypes) and look at the first example with time. It shows how to create one with a function.

Condor
26 Nov 2010, 7:13 AM
Or you could call two vtypes from the validator function.