We are looking for a way of passing generated content into the javascript (via database calls), and then a way of getting the selections back into a form element on the parent page (perhaps into hidden fields).
We do not know what the content will be in advance, and we don't know how many...