PDA

View Full Version : how to make textfield validation without scroll



yumusakg
22 Jun 2010, 10:32 PM
hi,

1. i have form fields. after validation the scrolls appear. how can i prevent them appear? i attached a screenshot of the problem.

the fields definition is as below;



{
xtype: 'fileuploadfield',
id: 'form-file',
emptyText: 'sešiniz',
fieldLabel: 'Dosya',
name: 'FileContent',
buttonText: '',
anchor: '100%',
allowBlank: false,
buttonCfg: {
iconCls: 'attach-icon'
}
}


2.i don't want to validate forms until submit occurs. for example when focus changes it validates the field, which i don't want. how can i a success that?

21063

pavanextjs
23 Jun 2010, 9:10 AM
1. Leave enough space for invalid icons, anchor your fields to less than 100% (try 90%)


{
xtype: 'fileuploadfield',
id: 'form-file',
emptyText: 'sešiniz',
fieldLabel: 'Dosya',
name: 'FileContent',
buttonText: '',
anchor: '90%', //change this
//allowBlank: false,
buttonCfg: {
iconCls: 'attach-icon'
}
}2. Don't use allowBlank: false in the field configuration, instead validate when you want and if validation fails change the property on the fly.


//if field validation fails...
field.allowBlank = false;
field.validate();