title: How to insert value of dynamically created input boxes into database
body: <p>hello developers i am creating 2 text boxes and 1 select box dynamically using java script function... now i want to post the value of (n) fields created into database (relevant table)
  as i am using codeigniter so m posting the script and code</p>
  
  <p>this is the simple java script that i am using</p>
  
  <pre><code>&lt;script&gt;
    var counter=1;
    function generateRow() {
      var count="&lt;font color='red'&gt;"+counter+"&lt;/font&gt;";
      var temp ="&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;div class='_25'&gt;&lt;input type='textbox' id='textbox' name='stop"+counter+"' placeholder='Stop Name'&gt;&lt;/input&gt;&lt;/div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;div class='_25'&gt;&lt;input type='textbox' id='textbox' name='timing"+counter+"' placeholder='Timing'&gt;&lt;/input&gt;&lt;/div&gt;&amp;nbsp;&lt;div class='_25'&gt;&lt;select id='ampm"+counter+"' name='ampm"+counter+"'&gt;&lt;option&gt;a.m&lt;/option&gt;&lt;option&gt;p.m&lt;/option&gt;&lt;/select&gt;  &lt;/div&gt;";
  
      var newdiv = document.createElement('div');
      newdiv.innerHTML = temp + count;
  
      var yourDiv = document.getElementById('div');
      yourDiv.appendChild(newdiv);
      counter++;
    }
  &lt;/script&gt;
  </code></pre>
  
  <p>and this is my division on php file</p>
  
  <pre><code> &lt;div id="div"&gt;
   &lt;/div&gt;
  
   &lt;p&gt;&amp;nbsp;&lt;/p&gt;
   &lt;div class="_25"&gt;
      &lt;p&gt;
        &lt;input type="button" name="button" class="button red" id="button" value="Add"  onclick="generateRow() "/&gt;&lt;/a&gt;
      &lt;/p&gt;
   &lt;/div&gt;
   &lt;input type='button' value='Remove Button' id='removeButton'&gt;
  </code></pre>
  
  <p>and this is my related table fields</p>
  
  <pre><code>route_number    stop_name   am_pm   timing
  </code></pre>