function fImport(){ var frm_import = new Ext.form.FormPanel({ xtype: 'form', enctype: 'multipart/form-data', title: 'Import Nilai', iconCls:'silk-user', buttonAlign: 'left', bodyStyle: 'padding: 5px', border: false, layout: 'border', waitMsg: 'Waiting...', maskDisabled: false, monitorValid: true, autoScroll:true, frame: true, items: [{ xtype: 'fieldset', flex: 1, region:'north', layout:'form', autoHeight:true, items: [{ xtype: 'fileuploadfield', id: 'filedata', name: 'filedata', emptyText: 'Select a document to upload...', fieldLabel: 'File', width:'50%', buttonText: 'Browse' } ] } ,{ region: 'center', layout:'form', autoScroll:false, items:[{ xtype: 'panel', layout:'fit', height:550, id:'cmdimport', frame:true, tbar: [{ text: 'Import..', id: 'idadd-stmhssmt', iconCls: 'silk-add', handler: function(){ // The getForm() method returns the Ext.form.Basic instance: var form = frm_import.getForm(); if (form.isValid()) { // Submit the Ajax request and handle the response form.submit({ url: 'akademik/Import', success: function(form, action) { alert('ok'); }, failure: function(form, action) { alert('fail'); } }); } } }] }], }] }); SET_PAGE_CONTENT(frm_import); function fnImport(){ if(frm_import.getForm().isValid()){ frm_import.getForm().submit({ url: 'akademik/Import', enctype: 'multipart/form-data', waitMsg: 'Uploading file...', success: function(form,action){ alert('Success'); } }); } } }