Preeti
Preeti

Reputation: 51

Issue with ExtJs 4 form submit

I am new to Extjs and java script. I have a simple form with 3 text field. On submit I want to go on next page(result page). When I click on submit button I see alert 1 but did not get Alert 2 and 3. I do see the response coming back in firebug but the result page does not get loaded. What am I doing wrong here, How do I load the next page? Any help will be appreciated.

Ext.require([
    'Ext.form.*'
]);

Ext.onReady(function() {

    var formPanel = Ext.create('Ext.form.Panel', {
        frame: true,
        title: 'New Todo',
        width: 340,
        bodyPadding: 5,
    url: 'result.html',
    ajaxSubmit:false,
        fieldDefaults: {
        labelAlign: 'left',
        labelWidth: 90,
        anchor: '100%'
    },

    items: [{
        xtype: 'textfield',
        name: 'id22',
        fieldLabel: 'id22',
        value: ''
    },{
        xtype: 'textfield',
        name: 'Summary',
        fieldLabel: 'Summary',
        value: ''
    }, {
        xtype: 'textareafield',
        name: 'Description',
        fieldLabel: 'Description',
        value: ''
    }],

    // Reset and Submit buttons
buttons: [{
     text: 'Submit',
    formBind: true, //only enabled once the form is valid
    disabled: true,
    handler: function() {
        var form = this.up('form').getForm();
        alert("1");
        form.submit({
                    //clientValidation: true,
                    url: 'result.html',
                    success: function(form, action) {
                       alert("2");
                    },
                    failure: function(form, action) {
                         alert("3");
                    }
                });

    }

}],


});

formPanel.render('form-todo');

});

Upvotes: 2

Views: 1850

Answers (1)

dbrin
dbrin

Reputation: 15673

I am not sure where you got the 'ajaxSubmit' config option from but according to the docs the standardSubmit option is the one you need.

Upvotes: 2

Related Questions