initializing with value submits value and not the id

Mar 25, 2009 at 4:43 PM
I was trying to set an initial value for the dropdown and noticed that the value itself and not it's JSON id was submitted with the form, even when a corresponding name entry was in the JSON object.
For instance:

$('#combo').flexbox({  
                     "results": [  
                         { "id": "1", "name": "Ant" },  
                         { "id": "2", "name": "Bear" },  
                         { "id": "3", "name": "Cat" },  
                         { "id": "4", "name": "Dog" },  
                         { "id": "5", "name": "Elephant" },  
                         { "id": "6", "name": "Fox" },  
                         { "id": "7", "name": "Guinea Pig" },  
                         { "id": "8", "name": "Horse" },  
                         { "id": "9", "name": "Iguana" },  
                         { "id": "10", "name": "Jaguar" }  
                     ], "total": 10  
                 }, {  
                     allowInput: true,  
                     paging: false, 
                     initialValue: 'Dog',
                 });

This will set the initial value correctly to 'Dog', but when submitting I expect to see '2' in the parameter, whereas right now I get 'Dog'. Is there a way to set initial value by id, so the initial value of '2' would be checked against the JSON object and interpreted as 'Dog'?
Coordinator
Mar 25, 2009 at 5:02 PM
Aha, I think that is a bug.  I'm going to promote it to a work item...

Thanks,
Noah
Coordinator
Mar 25, 2009 at 5:02 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.