Dynamically create textboxes using javascript and insert that text box values into mysql
<p>Hi i have created some text boxes dynamically using javascript according to the no of inputs.
I want to save that textbox values to mysql database. am very new to javascript. Thanks in advance.</p>

<p>Here is my code:</p>

<pre><code>    &lt;script&gt;

   function add_col()
   {
   var num_box = document.getElementById("num_text").value;
   if(num_box)
   {
   for(var i=0; i&lt;num_box; i++)
   {


   var tableName1 = document.getElementById("uTable");

   var newTR1 = document.getElementById("tr1");

   var newName1 = document.createElement("TD");

   newName1.innerHTML = "&lt;input type='text'  name='site' id='site' value='cell value'&gt;";

   var newTR2 = document.getElementById("tr2");

   var newPhone1 = document.createElement("TD");

   newPhone1.innerHTML = "&lt;input type='text'  name='cell' id='cell' value='site value'&gt;";


   newTR1.appendChild(newName1);

   newTR2.appendChild(newPhone1);

   tableName1.appendChild(newTR1);
   tableName1.appendChild(newTR2);


    document.form1.reset()



    }

   }

   }
   &lt;/script&gt;


    &lt;form name="form1" id="form1" method="post"&gt;

        &lt;p&gt;
          &lt;input type="text" name="num_text" id="num_text"/&gt;
          &lt;input type="button" name="Submit" value="INPUT" onclick="add_col();" /&gt;
        &lt;/p&gt;
        &lt;p&gt;&amp;nbsp;&lt;/p&gt;
        &lt;table  id="uTable"width="183" border="0"&gt;
          &lt;tr id="tr1"&gt;
            &lt;td&gt;Name&lt;/td&gt;

          &lt;/tr&gt;
          &lt;tr id="tr2"&gt;
            &lt;td&gt;Phone&lt;/td&gt;

          &lt;/tr&gt;

      &lt;/table&gt;
        &lt;input type="submit" name="Submit2" value="Insert"  /&gt;
    &lt;/form&gt;
</code></pre>
