I'm trying to get a simple combobox in ExtJS 5 to submit both the value and text of the selected element. From everything I've read it seems like this should work if I include the hiddenName property for the combo but I cannot get it to submit both.
Here is the relevant combobox config:
name: 'myCombo',
hiddenName: 'myComboId',
submitValue: true,
xtype: 'combo',
queryMode:'local',
valueField: 'id',
displayField: 'state',
And here is a jsFiddle with this all set up: fiddle
If you look in firebug/chrome debugger at the request to my fake url when the form is submitted, you'll see that only 'myCombo' is submitted when I'm also expecting 'myComboId'.
Any help would be greatly appreciated, thanks.
myCombo=newtext
for newly created entries, andmyCombo=<ID>
for existing ones. Why won't you just make the server side see that whenever the value arrived is not an existing ID, it must be a new text value to be added to the database? – GreendrakehiddenName
is quite unclear to me. I can't see why you think it would do what you expect. To accomplish your task I would use the combo's store and save any new records created in there through a proxy — instead of submitting forms and juggling hidden fields. – Greendrake