When you use Ext JS’s ComboBox, if you don’t set hidden name or id, it send display field value, not value field. To handle this, it has to be set. Be careful about uniqueness of the hidden name, for more details you can check Ext JS ComboBox’s documantation
var unitField = new Ext.form.ComboBox({
id:'unitField',
name: 'unit',
fieldLabel: 'Unit',
store:unitStore,
mode: 'remote',
displayField: 'name',
valueField: 'id',
hiddenName : 'unitId',
allowBlank: false,
anchor:'95%',
triggerAction: 'all'
});

All I gotta say is YOU ROCK! This helped me resolve my problem very quickly. Couldn’t figure out what the problem was until I read this. Reading the documentation is important, but it’s easy to miss things like this. Thanks!!!
Tony
Hello help me!
How to get the HiddenName value of combo box , give some code plz..!
What do you want to do exactly? send the selected value in a form post or find the combobox component and get the hiddenName from the compoenent in javascript?
Awesome, I was looking for ways to overcome this problem, but your solution is simplest and most beautiful.
Thanks,
-Lilit
[...] comboBox 设置发送到数据库的值 http://turgaykivrak.wordpress.com/2008/05/19/extjs-20-tip-how-to-make-combobox-send-value-field/ 转载本文请注明:转载自 天天成长的博客 http://www.ddgrow.com [...]
Thank you!!!!
thanks
thank you, i can resolve my problem………………………..
hoaaaaaaaaaaaaaaaahh… you help me a looootttt
thank you
)
TTTTTTTTTTHHHHHHHHHHHHHHHAAAAAAAAAAAAANNNNNNNNNKKKKKKKKK YYYYYYYYYOOOOOOOOOUUUUUUUUUUUUUUUUU
i mean thank you very much!
Thanks a lot! Took me f*cking hours to find this!
great!
Thanks!!!
Extremely helpful. Thanks a lot
[...] Взял отсюда [...]
Still does not work for me…
var combo_organismosID = new Ext.form.ComboBox({
labelStyle: ‘font-weight:bold;’,
fieldLabel:’Organismo’,
displayField: ‘organismo’,
valueField: ‘valor’,
forceSelection:true,
minChars: ’1′,
typeAhead: true,
editable : true,
autoLoad:true,
name:’combo_organismos’,
mode: ‘remote’,
selectOnFocus:true,
emptyText:’Organismo Responsable del Proyecto…’,
id:’organismo’,
triggerAction:’all’,
store:organismos,
hiddenname: ‘valor’,
allowBlank:false
});
hiddenname: ‘valor’ should be hiddenName:’valor’ and in the form post, it will send the value as valor.
Thank you. it worked
Thanks for setting focus on hidden attrib
Hi, Im new to php crosstab reports ,so want how to create the crosstab reports.pls help meeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee………………………….
Hi,
Unfourtunately I am not a php developer/expert. But I think you can find samples by googling.
Maybe also some javascript code.
Kind regards
Turgay
Helped me too. Only side effect is now when you do form.getValues, you get an extra field with same value as the actual combo. I wish I could get away from that, but it’s only an inconvinience.