PDA

View Full Version : Cross field validation



jimmyphp
19 May 2007, 8:17 AM
Hi all,

I have trid to validate with vtype two combobox using this thread suggestion:

http://extjs.com/forum/showthread.php?t=5717&highlight=vtype



Ext.form.VTypes.lessThan = function(v, field){
var relatedField = Ext.get(field.relatedField);
return field.getValue() < relatedField.getValue();
});



but field.getValue() return not value of combobox but displayText.

Thank's in advance & sorry for english.

Animal
19 May 2007, 11:34 AM
Ext.get accesses a basic Ext.Element which is a wrapper for DOM objects, not a fully built widget.

Ext.form.Fields (and other Ext widgets increasingly) are Ext.Components, and are registered with a Component manager object.

To access a Component by its id, use Ext.ComponentMgr.get()

Items in bold are class names - read up about them at the doc centre.