title: Adding a unique name to cloned form elements
body: <p>We are using the following code to create a form that can be extended with the press of a button, but we are having trouble adding a unique name to the input fields. We had it working to add a unique ID, but when we changed it to the name it stopped working. Help? :( Many thanks for any advice.</p>
  
  <pre><code>var counter = 0
  function cloneRow() {
     counter ++;      
     var row = document.getElementById("rowToClone"); // find row to copy
     var table = document.getElementById("tableToModify"); // find table to append to
     var clone = row.cloneNode(true); // copy children too
     var theName= row.name;
     clone.name = theName + counter++; // change id or other attributes/contents
     table.appendChild(clone); // add new row to end of table
  }
  </code></pre>