title: Javascript get form array values
body: <p>I have a form that is set up so that there is an add button so my user can submit multiple people at once to the site. </p>
  
  <p>At first the form has an input to fill out the persons name one example below</p>
  
  <pre><code>&lt;input type="text" name="name[]" value="Name" /&gt; 
  </code></pre>
  
  <p>If they hit the add button another one is appended so that I'm left with the following</p>
  
  <pre><code>&lt;input type="text" name="name[]" value="Name" /&gt; 
  &lt;input type="text" name="name[]" value="Name" /&gt; 
  </code></pre>
  
  <p>Then when they hit submit I'm trying to get the values of each name in Javascript and loop through them I've tried this but it's not working</p>
  
  <pre><code>var inputs = document.getElementById('formIDhere').getElementsByTagName('name');
  alert(inputs.length);
  </code></pre>
  
  <p>I never get the alert and if I just set up a loop like this</p>
  
  <pre><code>for(int i=0; i&lt;inputs.length; i++)
  </code></pre>
  
  <p>Nothing happens, any help on looping through the values of name[] in javascript would be greatly appreciated</p>