Sanjoy Roy

[MCM, MCP, SCJP] – Senior Programmer, Sites n Stores Pty Ltd.

Form Submit with additional parameters using Sencha (ExtJS)


To submit a form with additional parameters with the form fields, config the param field array like below:

profileForm.getForm().submit({
    clientValidation: true,
    url: 'account-processor.php',
    params: {
        task: 'saveProfile',
        sid: SERVICE_SID,
        acc_id: ACCOUNT_ID,
        service_id: SERVICE_SELECTED,
        new_username: NEW_USERNAME
    },
    success: function(form, action) {
       Ext.Msg.alert('Success', action.result.msg);
    },
    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.msg);
       }
    }
});

One Response to Form Submit with additional parameters using Sencha (ExtJS)

  1. Medalla 06/10/2011 at 12:09 AM

    Fantastic, just what I was looking for. Thank you

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.