PDA

View Full Version : Is it possible to create nested FormPanels?



leonid1
31 Jul 2009, 5:07 AM
Here is the code


Ext.onReady(function() {
var myForm2 = new Ext.FormPanel({
title: 'MyForm2',
height: 100,
frame: true,
items: [new Ext.form.TextField({
fieldLabel: 'ccc',
value: 'ddd'
})
]
});
var myForm1 = new Ext.FormPanel({
title: 'MyForm1',
height: 200,
frame: true,
items: [new Ext.form.TextField({
fieldLabel: 'aaa',
value: 'bbb'
}),
myForm2
]
});

p = new Ext.Viewport({
items: [myForm1]
});
})



It gives error both in IE and Firefox. If I change


var myForm2 = new Ext.FormPanel({


with


var myForm2 = new Ext.Panel({


all works as expected. So, what's wrong with the code above?

tryanDLS
31 Jul 2009, 6:28 AM
You can't nest FORM tags per the W3C HTML spec.

leonid1
31 Jul 2009, 11:52 AM
Thanks