tags:

views:

73

answers:

1

When submitting a form with Extjs I can see the form items have values with this code 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({...

But when the request arrives at the handling page the form items are not there. I can see the request details with Firebug.

One of the form items 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'
});

This is Extjs 2.1

+1  A: 

You need to specify the "name" property in order to map the control to a form name-value pair.

CrazyEnigma
I added the name property and now it shows at the requested page, but in instead of the value field to be assigned what is assigned is the sum of the valueField and displayField. Say the valueField is "1" and the displayField is "some text" then what goes with the request is "1 (some text)" and not just the valueField. Don't know if I should open another question for this or edit this question.
Kakao
You can check out the hiddenField Property. And if this is a combo, hidden fields have to be set.
CrazyEnigma