Sending many values from child to parent window

Hi,

I need to send possibly many values from a popup child window to a parent window. Say:

List of Fruit:
Apple [Add]
Banana [Add]

Each click of add adds the fruit into a input text box, on the parent page.

Ive found this: http://www.plus2net.com/javascript_tutorial/window-child3.php

I could make a form for every fruit and send it back this way. It is troublesome, but can be done. Is there a more elegant solution?

Pass an array of values, or push single values onto an array.


opener.fruits = myArray;
//or
opener.fruits.push(fruit);