Concatenate values from script-created list into one field
<p>How do I concatenate data from text fields in a script-created list, where the text field names will always be the same as each other? Allow me to explain:</p>

<p>I have a series of points that get added to a list that is create using javascript. This is the script to create the list:</p>

<pre><code>var src = this.parentNode;
var field = $('&lt;input type="text" id="savedpoints" name="savedpoints"&gt;').attr({'value': $(src).data('dbId')});
var but = $('&lt;button&gt;').append('&amp;nbsp;&amp;nbsp;Remove&amp;nbsp;&amp;nbsp;');
var newItem = $('&lt;li&gt;').append(field).append($(src).data('marker').title);
newItem.append('&amp;nbsp;').append(but);
$(but).click(poi.removeItem);
$(poi.saveList).append(newItem);
</code></pre>

<p>So, there are items getting added to a list with a button next to them to remove them from the list if they are no longer needed. This list works perfectly.</p>

<p>What I need is to add the values to a text field at the bottom of the form (say, name="allpoints") that concatenates the field values from this list (the text field labelled "savedpoints", with the attribute 'dbId') into a string (e.g. "6, 7, 10, 13, 14,..." etc) whenever an item is removed from or added to the list. I can't work out how this might work!</p>

<p>Any help?</p>
