PDA

View Full Version : variable access problem + FormPanel



lormitto
7 Feb 2010, 2:23 AM
I can not find solution for my problem. I believe it is combined with variables access in form.

Yestaerday I had the same problem but I made some progress, at least I know what issue i must face


Part of code:




var simpleForm2 = new Ext.FormPanel({
title: '',
bodyStyle: 'padding:5px',
width: 850,
labelWidth: 180,
frame: true,
items: {
layout: 'column',
border: false,
defaults: {border: false},
items: [{
columnWidth: 0.45,
items: [{
layout: 'form',
border:false,
defaultType: 'textfield',
items: [


{
fieldLabel: 'test1',
name: 'test1',
id: 'test1',
allowBlank:false
}
,{
fieldLabel: 'test2',
name: 'test2',
allowBlank:false
}

]
}, {
columnWidth: .55,
layout: 'form',
defaultType: 'textfield',
items: [
//******************** 2nd column *******************************//

{


xtype: 'fieldset',
title: 'test fieldset',
id: 'fieldsettest',
hidden: true,
defaultType: 'textfield',
height: 160,
items: [

{
fieldLabel: 'test3',
name: 'test3',
id: 'test3',
allowBlank:false,
hidden: true
}
]},


]
}
],


buttons: [{
text: 'save',
handler: function () {
var conn = new Ext.data.Connection();
conn.request({
url: 'phpExe.php',
params: {action: 'insert'
,scope: this
,comment: test1

},
success: function () {
Ext.MessageBox.alert ('ok');

simpleForm2.getForm().reset();
},
failure: function () {
Ext.MessageBox.alert ('failure');
}


});}
},{
text: 'cancel',
handler: function () {

simpleForm2.getForm().reset();
}
}]

}
});


Firebug says: "test1 is not defined" (line: comment: test1). Do you perhaps know what to do in this case. I think access to test1 variable is restricted somehow but can not uderstand how. Thank you for any advice.

lormitto
7 Feb 2010, 4:00 AM
I found a problem I think.

All fields in Form have to be filled before uploading. I will investigate it now.