Bia1974
Bia1974

Reputation: 105

Unable to get callback response in form submit

I'm going crazy. I've read forum, questions, answers, no way to get callback response!! My code:

var myFormTest = new Ext.form.FormPanel({
renderTo: 'divAllegati',
width: 500,
title: 'Allegati',
bodyPadding: '10 10 0',
standardSubmit: true,
items: [{
    xtype: 'textfield',
    fieldLabel: 'Name',
name: 'ciao',
value: 'ciao'
},{
    xtype: 'filefield',
    id: 'form-file',
    emptyText: 'Seleziona un file',
    fieldLabel: 'Allegato',
    name: 'photo-path',
    buttonText: '',
    buttonConfig: {
        iconCls: 'upload-icon'
    }
}],
buttons: [{
    text: 'Save',
handler: function(){
    if (myFormTest.getForm().isValid()) {
        myFormTest.getForm().submit({
        url: '/uploadAllegati',
        waitMsg: 'Caricamento allegati...',
        success: function (form, action) {
            Ext.Msg.alert('Success');
        },
        failure: function (form, action) {
            Ext.Msg.alert('Failure');
        }                                   
            });
    }
    }
}]

});

No way to get success or failure!! My server send back this:

ResponseInfo.ResponseNo := 200;
ResponseInfo.ContentType := 'text/html';
ResponseInfo.ContentText := '{success:true}';

But all I have as response, is a blank page with

{success:true}

No message, no alert, no callback....

Please help, really going crazy!

Upvotes: 2

Views: 3000

Answers (2)

Bia1974
Bia1974

Reputation: 105

Solved with standardSubmit: false Sometimes, easy thing are invisible :D I tried any way to solve my problem, changed my server in any way, but I didn't find the right answer. Thanks Vlad!

Upvotes: 0

Vlad
Vlad

Reputation: 3645

standardSubmit: false,//true, <---------

Upvotes: 2

Related Questions