PDA

View Full Version : validate form multiple tabs problem



damien
11 Dec 2007, 11:15 AM
I have multiple tabs on a panel. Every tab has a form. If an inputfield on a form is invalid i want that tab to be activated before i submit the forms. I have this code that works fine. But it doesn't work on a tab with columns.



save.on('click',function(){
if (!simple.getForm().isValid()) {
var activeTab = tabs.getActiveTab();
var activeTabValid = true;
activeTab.items.each(function(f){
if(f.validate && !f.validate()){
activeTabValid = false;
}
});
if (activeTabValid) {
simple.getForm().items.each(function(f){
if(f.validate && !f.validate()){
tabs.setActiveTab(f.ownerCt);
f.markInvalid();
return false;
}
});
}
}else{
form.submit();
});
}
});
I get the error:

Ext.fly(el) has no propertiesIt seems to go wrong on line 18795 in the ext-all-debug.js


var el = this.getTabEl(item);
the "el" seems to be empty. I need some help with this one. Thanks.