PDA

View Full Version : valueField issue



silve69
20 Jul 2009, 9:52 PM
Hello guys,

I have the follow combobox inside a formpanel:



...
some code here
...
new Ext.form.ComboBox({
fieldLabel: 'Status',
tabIndex: 4,
store: new Ext.data.ArrayStore({
fields: ['the_id', 'the_text'],
data: [[1,'In Process'],[2,'Stand By'],[3,'Active'],[4,'Deleted']]
}),
displayField: 'the_text',
valueField: 'the_id',
mode: 'local',
emptyText: 'Select Status',
value: 'Active', //default value
name: 'userstatus_id',
typeAhead: true,
forceSelection: true,
triggerAction: 'all',
width: 160,
selectOnFocus:true
})
...
some code here
...

The problem:
When I "submit" the data to PHP I'm receiving always the "the_text" field insted "the_id" field.
Also, I tryed using hiddenName but with the same result.

What I need to change for receiving the right field?
Best regards and thanks in advanced,

Silver

Condor
20 Jul 2009, 11:18 PM
name -> hiddenName

silve69
21 Jul 2009, 12:20 AM
Thank you Condor, by your quickly answer... but really, I don't know which are the changes to do...
i was trying name: 'value' and another combinations but with the same results.
Can you show me the code to change, please??

Best regards!!!!
Silver

Condor
21 Jul 2009, 12:27 AM
Just change:

name: 'userstatus_id',
to

hiddenName: 'userstatus_id',

silve69
21 Jul 2009, 12:55 AM
Thank you!!! now it's working!!!