tags:

views:

336

answers:

1

I can see what are the values of the fields just before the submit:

var itemsForm = '';
function mostraItems(item, index, length) { itemsForm += item.id + ':' + item.name + ':' + item.value + ':' + index + '\n'; }
myForm.form.items.each(mostraItems);
alert (itemsForm);
myForm.form.submit({...

The problem I have is that the submitted values are different from what I can see before the form.submit() call. One of the fields is a ComboBox:

var myCombo = new Ext.form.ComboBox({
//autoWidth: true,
width: 250,
displayField: 'theFieldText',
editable: false,
emptyText: 'Select something ...',
fieldLabel: 'Some text',
listeners: { 'select': { fn: theOnSelect, scope: this} },
mode: 'local',
selectOnFocus: true,
store: theStore,
triggerAction: 'all',
typeAhead: true,
valueField: 'theFieldValue',
name: 'fieldName'
});

What is going in the request is the sum of the valueField and the displayField. Say the value field contains "1" and the displayField contains "some text" then what goes in the request is "1 (some text)" in instead of just the value "1".

There is something happening after or during the form.submit() call and I can't find what it is.

Using Ext 2.3

A: 

There isn't anything unusual happening during form submit call.

First of all, check the form values just before the form is submitted (but not the way you do it now). Do you use Firebug (I hope yes)?

myForm.getValues();

gives you key/value pairs as they will be submitted.

So type into console

Ext.getCmp('your-form-id').getForm().getValues();

or put into your code

console.log(myForm.getValues());

instead of alert() and see an output. Then, when you submit the form in a standard way

myForm.submit({url: 'submit-url'})

there is no chance your values will be different. How do you submit the form?

Igor Pavelek