title: Javascript variable in element name
body: <p>I have a text box, and a select box with choices that are the same as the columns in a table.  I want to be able to type in the box, select a column, press a button, and have it copy whatever is in the box, to every box in the column.  I am having a hard time with the syntax as using a variable is the only thing that prevents this from working.  When I put in real values, it works fine.</p>
  
  <pre><code>function testScript(fill) {
  choice=document.form1.column.value;
  alert (fill);
  alert (choice);
      for($i=0;$i&lt;fill;$i++){
          document.form1.choice[$i].value=document.form1.copy.value;
      }
  }
  </code></pre>
  
  <p>Fill (tested by the alert) provides me with the number of rows in the table and works fine.  Choice is my select (drop down) box.  If I type in "document.form1.make[$1].value= it fills what I type in every row of the make column.  If I choose make in the select box, choice does say make as indicated by my test alert.</p>
  
  <p>Any ideas how to use the variable correctly in the for loop?</p>