PDA

View Full Version : TextField validation property



couetbis
10 Sep 2010, 1:33 AM
Hi,
I want to add a property on textfield and use it to validate or not content.
The property is something like allowBlank but verify if content is different of space character (use trim function).

How I do this ?

Thanks in advance

Condor
10 Sep 2010, 1:57 AM
validator: function(value){
return Ext.util.Format.trim(value) ? true : 'This field is required';
}
or maybe you even want:

stripCharsRe: /(^\s+|\s+$)/g

couetbis
10 Sep 2010, 3:39 AM
Thanks for your reply, validator solution is good :)