How do you combine a form element with a variable?
<p>First, how do you append data to the end of a variable in Javascript? I know for PHP you use:</p>

<pre><code>$foo = "bar";
$foo.= "bar2";
</code></pre>

<p>Next, I can get the following to work for one form field:</p>

<pre><code>var test = document.form1.option1.value;
</code></pre>

<p>However, how would I go about doing this with a for loop whilst appending each iteration onto the end of the variable? For example (where XXX is the loop variable i):</p>

<pre><code>for(i=0; i&lt;10; i++){
    test.= document.form1.optionXXX.value;
}
</code></pre>

<p>Basically, I need all the data from a random set of form fields that can range anywhere from option1 to option20. Thanks.</p>
