Results 1 to 6 of 6

Thread: Combobox return the wrong value

  1. #1
    Sencha User
    Join Date
    Dec 2010
    Location
    The Netherlands
    Posts
    70

    Default Combobox return the wrong value

    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.

  2. #2
    Sencha User
    Join Date
    Nov 2010
    Location
    USA
    Posts
    111

    Default

    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

  3. #3
    Sencha User
    Join Date
    Dec 2010
    Location
    The Netherlands
    Posts
    70

    Default

    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?

  4. #4
    Sencha User
    Join Date
    Nov 2010
    Location
    USA
    Posts
    111

    Default

    '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

  5. #5
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    A combobox consists of 2 inputs, the text input (with name) and a hidden input for the value (with hiddenName).

  6. #6
    Sencha User
    Join Date
    Dec 2010
    Location
    The Netherlands
    Posts
    70

    Default

    Ah, that explains why the text-input was transmitted, and not the value.
    Thanks!

Similar Threads

  1. Replies: 8
    Last Post: 11 Oct 2014, 6:59 AM
  2. Replies: 1
    Last Post: 5 Jun 2009, 1:27 PM
  3. Replies: 1
    Last Post: 1 May 2009, 11:26 AM
  4. Replies: 3
    Last Post: 11 Mar 2009, 4:11 AM
  5. [GRID] Using validateedit, how to cancel wrong value and return to same field?
    By LeonardoAP in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 21 May 2008, 11:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •