0
我有一個使用'表單'xtype定義的ExtJS表單面板。當用戶點擊提交時,這個表單的url根據他們在哪個頁面被改變。它是一個文件上傳表單。在IE7中,url參數完全被忽略,並且返回的字符串是來自網站根目錄的HTML。在IE8,FF和Chrome中,這很好。ExtJS,IE7表單提交問題
是否有某種安全設置或其他我應該尋找的東西? URL參數似乎被完全忽略,導致文件上傳失敗。
代碼表(表格是在一個窗口中):
items: [{
xtype: 'form',
fileUpload: true,
baseCls: 'x-window',
bodyStyle: 'font-family:tahoma;font-size:12px;',
defaults: {
bodyStyle: 'font-family:tahoma;font-size:12px;',
width: 200
},
items: [{
xtype: 'hidden',
name: 'action',
value: 'import'
}, {
xtype: 'fileuploadfield',
fieldLabel: 'Import File',
name: 'uit'
}]
}],
fbar: [{
text: 'Import',
handler: this.handleImportFn,
scope: this
}, {
text: 'Cancel',
handler: function() {
var myB = this;
myB.disable();
this.ownerCt.ownerCt.hide();
myB.enable();
}
}]
表單提交:
form.submit({
params: {
id: id
},
url: this.superParent.myBasicURL // This has been verified valid,
waitMsg: 'Uploading file',
success: function (form, action) {
var resp = Ext.decode(action.response.responseText),
addSucc = resp.addSucc || false,
msg = 'Import completed successfully.';
if (addSucc) {
if (typeof resp.skipped !== 'undefined' && resp.skipped > 0) {
msg += " " + resp.skipped + " records skipped [" + resp.skips + "].";
}
Ext.MessageBox.alert("Info", msg);
myStore.load();
myWin.hide();
}
else {
Ext.MessageBox.alert("Error", resp.error);
}
},
failure: function (form, action) {
switch (action.failureType) {
case Ext.form.Action.CLIENT_INVALID:
Ext.Msg.alert('Failure', 'Form fields may not be submitted with invalid values');
break;
case Ext.form.Action.CONNECT_FAILURE:
Ext.Msg.alert('Failure', 'Ajax communication failed');
break;
case Ext.form.Action.SERVER_INVALID:
Ext.Msg.alert('Failure', action.result.error);
break;
}
}
});
謝謝...
你可以添加一些HTML表單的源代碼嗎?很難說出問題的根源在哪裏。 – mrk