0
votes

I have an ExtJS form panel defined using the 'form' xtype. When the user clicks submit this form's url is changed based on which page they are on. It is a file upload form. In IE7 the url parameter is completely ignored and the returned string is the HTML from the root of the website. In IE8, FF, and Chrome this works perfectly fine.

Is there some kind of security setting or something else I should be looking for? The URL parameter seems to be completely ignored resulting in a failed file upload.

Form Code (Form is in a window):

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 Submission:

            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;
                }
            }
        });

Thanks...

1
Can you add some the source code of the HTML form? It is hard to tell where a problem could be based just on your question. - mrk

1 Answers

0
votes

I've found a very strange behavior with IE7 forms. In my case it "might" be an issue with Dojo but it's the same symptoms you have with IE7. I'm too lazy to verify with a standard form.

If I have a hidden field named action IE7 will completely ignore the form action parameter and POST the form to the current page. Essentially it's acting as if action was not specified.

Now I found this issue working with but seeing as it works in IE8 and others something has to be different with the IE7 code regarding action parameter.