title: 'undefined' elements in the array
body: <p>I have the following JavaScript I am using to save selected check boxes:</p>
  
  <pre><code>function SubmitCheckBoxes()
  {
      alert("test");
      var selectedIDs = [];
      var x = 0;
      a = document.getElementsByTagName("input");
      for (i = 0; i &lt; a.length; i++) {
  
          if (a[i].type == "checkbox" ) {
              if (a[i].checked) {
                  alert(a[i].value);
                  selectedIDs[x] = a[i].value;
                  x++;
              }
          }
      }
      $.post('./Courses/SaveAndRedirect', selectedIDs, function (data) { });
  }
  </code></pre>
  
  <p>However when I look at the form data being submitted all its says is <code>undefined: undefined</code> for each element in the array.</p>
  
  <p>Not sure what the problem is here.  </p>