var formPanel = Ext . create ( 'Ext.form.Panel' , { renderTo : 'testdiv' , title : 'MyForm' , id : 'testCase' , items : [ { xtype : 'textfield' , name : 'title' , fieldLabel : 'Title' }, { xtype : 'panel' , layout : 'fit' , border : false , items : [{ xtype : 'filefield' , buttonOnly : true , name : 'file' , onChange : function ( value ) { var panel = this . ownerCt ; formPanel . submit ({ url : 'upload.json' , waitMsg : 'Uploading the image ..' , clientValidation : false , success : Ext . Function . bind ( panel . o...