Q:

jQuery - Best way to populate a hidden field with list data?

I have two unordered lists populated with users. The idea is to drag users from one list to add them to a group in the other list. Each user also has a dropdown to select a role in the group.
I'd like to add to/remove from a hidden field with the values of the "added" users and their role. I'm not really sure though how to do that.
I have a jsfiddle showing the general idea here: http://jsfiddle.net/KPdAX/

A:

Please see:
http://jsfiddle.net/KPdAX/1/
What I added based on your code are:

Use an array to keep track of both of the list items;
Print out the id/value pairs for both of the lists.

I don't know what you want a hidden field to keep track of the items. If you want to keep it in the HTML, you can easily create a hidden field, and dump the list strings in the hidden input tags.

