2011-06-28 33 views
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; 
       } 
      } 
     }); 

謝謝...

+0

你可以添加一些HTML表單的源代碼嗎?很難說出問題的根源在哪裏。 – mrk

回答

0

我發現IE7的形式很奇怪的行爲。在我的情況下,它可能是Dojo的一個問題,但它與IE7有相同的症狀。我懶得用標準表格來驗證。

如果我有一個名爲隱藏字段行動 IE7會完全忽略形式行動參數和POST形式到當前頁面。基本上,它的行爲就像沒有指定行動一樣。

現在我發現這個問題的工作,但看到因爲它在IE8和其他工作,有些事情必須與IE7代碼有關的行動參數不同。