bala2111 0 Newbie Poster

Please go through the below fiddle. I am trying to get the ids of the selected products in the fcbkcomplete box and show it as comma separated values in the textbox with id interest. I wrote a function to achieve that but i couldn't do it. The function adds the id of the first value and not taking the ids of the other values which are added in the multiple selection box.

http://jsfiddle.net/balac/xDtrZ/1/

I have added `json.txt`. it contains datas like this

[{"key":"2", "value":"Canon Powershot "},{"key":"3", "value":"Fastrack Bag"},{"key":"4", "value":"Iphone 4 "},{"key":"5", "value":"Levis Jeans"},{"key":"7", "value":"Indig"},{"key":"8", "value":"Dashing Cars"},{"key":"9", "value":"dsdas"},{"key":"10", "value":"fsfs"}]

in the above json value key is the id which i want to display in the textbox as comma separated values. value is the value which will be coming in the dropdown for selection.

while selecting the values in the drop down i want the corresponding key to get added in the textbox as comma separated values.

The problem is that only the key of the first selected item is getting added in the textbox, no matter.

Hope am specific and said all in detail. if anyone want any clarification please ask me i will explain more.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.