PDA

View Full Version : Combobox return the wrong value



Ooypunk
24 Dec 2010, 1:43 PM
Hello all,
This is probably a very simple question, but I fail to find the answer, so I'm hoping someone can help me.

The problem is this: I get the combobox working in a form, all fine there. The array consists of a combination of an ID and a text part. It's all displayed as it should, only if the form is submitted, the text part is sent, not the ID. What am I doing wrong?

Thanks in advance.


PS. I hope my story is clear, English is not my first language.

aramaki
24 Dec 2010, 4:45 PM
Hi, you need to specify some parameters in combo:
valueField: 'ID',
textField: 'Text',
hiddenName: ID of you combo
then, check your query params via firebug

Ooypunk
25 Dec 2010, 12:58 AM
Ah, hiddenName did the trick. Thanks! I couldn't figure what it was for. :)

The other parameters I had already found and set (I take it textField should be displayField?).

Thanks again!

Edit: I did have 'name' parameter set: what does that do then?

aramaki
25 Dec 2010, 10:15 AM
'name' attribute is like simple html atttribute (for example <a name='myName'>);
id is Ext`s attribute
if you specify name it`s possible to skip ID parameter

Condor
25 Dec 2010, 1:07 PM
A combobox consists of 2 inputs, the text input (with name) and a hidden input for the value (with hiddenName).

Ooypunk
25 Dec 2010, 2:07 PM
Ah, that explains why the text-input was transmitted, and not the value.
Thanks!