Populate textarea based on radio button selection

I’ve figured out how to get contents into a textarea based on a radio button selection.

text = new Array()
text[0] = Array('Saab','Volvo','BMW'); 
text[1] = 'second list';
function populate(r,f){
for(var i=0;i<f.elements[r].length;i++){
if (f.elements[r][i].checked){
var t=i;
<textarea name="txt" cols="20" rows="4"></textarea>
 <input type="radio" name="radio" value="0" onClick="populate(this.name,this.form)">
  Default List&nbsp;&nbsp;
 <input type="radio" name="radio" value="1" onClick="populate(this.name,this.form)">
  Another List&nbsp;&nbsp;


But what I can’t figure out is how to separate the lists line-by-line. For example: presenting the first selection above as


as opposed to

Saab, Volvo, BMW

I assumed I would have to make an array within as array to accomplish this. Am I on the right track?

I assume you mean a multi-dimensional array? Mind expanding on the thought? I’m trying to vision it in my head, but I don’t see where you’re tryin to go…

Nice, thanks man. I appreciate it :slight_smile:

replace with below portion…

    f.txt.value= text[t].toString().replace(/,/gi,"\