title: How to get value from JS-Generated HTML inputs in PHP using POST or GET
body: <p>I am making a grid of inputs using javascript. Each of these inputs has a unique name and id: "test1","test2"... I'm also able to change the style of these inputs based on their name.</p>
  
  <pre><code>var c = document.getElementById("gridOne");
  
  function createTable() {
  var table = document.createElement('table');
  var rows = +document.getElementById('numRows').value;
  var cols = +document.getElementById('numCols').value;
      var n = 0;
  for(var r=0; r&lt;rows; r++) {
    var tr = document.createElement('tr');
    table.appendChild(tr);
    for(var c=0; c&lt;cols; c++) {
      if(r == 0 || c == 0 || r == rows - 1 ||c == cols - 1 ){ 
          var td = document.createElement('td');
          tr.appendChild(td);
          var inp = document.createElement('input');
          inp.setAttribute('id', 'test'+n);
          inp.setAttribute('name', 'test'+n);
          inp.setAttribute('value', n);
          inp.setAttribute('type','number');
          td.appendChild(inp);
          n++;
  
  
      } else {
          var tq = document.createElement('td');
          tr.appendChild(tq);
          tq.classList.add('inner');
          var inp = document.createElement('input');
          inp.setAttribute('type','text');
          inp.disabled = true;
          tq.appendChild(inp);
      }
    }
  
  }
  var container = document.getElementById('input_container');
  container.innerHTML = '';
  container.appendChild(table);
  }
  </code></pre>
  
  <p>The HTML code that is handling and outputting the JavaScript is this</p>
  
  <pre><code>&lt;form method="POST"&gt;
  &lt;div class="canvas" id="input_container"&gt;
  &lt;script type="text/javascript" src="js/Grid1.js"&gt;&lt;/script&gt;
  &lt;/div&gt;
  &lt;input name="Confirm" type="submit"&gt;
  </code></pre>
  
  <p>When i try to access the values submitted by these inputs i'm getting an error. I'm using PHP, ive tried both GET and POST but im getting no luck.</p>
  
  <pre><code>    if (isset($_POST['Confirm'])) 
  {
      $test0 =  $_POST['test0'];
      $test1 =  $_POST['test1'];
      $test2 =  $_POST['test2'];
  }
  </code></pre>
  
  <p>My code works for everything except the dynamically generated input forms.</p>