title: how to get textbox array using javascript
body: <p>I have this form below.</p>
  
  <pre><code>&lt;form id="upload_form" enctype="multipart/form-data" method="post"&gt;
    &lt;input type="text" name="name[]" id="name"&gt;&lt;br&gt;
    &lt;input type="text" name="name[]" id="name"&gt;&lt;br&gt;
    &lt;input type="file" name="file1" id="file1"&gt;&lt;br&gt;
    &lt;input type="button" value="Upload File" onclick="uploadFile()"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>and this is my function uploadFile.</p>
  
  <pre><code>function uploadFile(){
      var file = _("file1").files[0];
      var name = _("name").value;
      alert(name); 
      var formdata = new FormData();
      formdata.append("file1", file);
      formdata.append("name", name);
  </code></pre>
  
  <p>Now my problem is I want to get the value of my textbox array which is the <code>name[]</code>..when I try to alert the name variable only the first index is showing up..any help will be appreciated.thanks in advance.. </p>