title: dynamic form in jsp
body: <p>I built a dynamic table in JSP using JavaScript. In that scenario when I click on "add more" link it adds rows to the table. But I'm unable to capture and pass those values to the database using java. How can I do that using javaScript?</p>
  
  <p>Here I've attached the javaScript I used to add rows</p>
  
  <pre><code>function addRow(tableID) {
          var table = document.getElementById(tableID);
          var rowCount = table.rows.length;
          var row = table.insertRow(rowCount);
          var cell0 = row.insertCell(0);
      cell0.innerHTML=rowCount ;
          var cell1= row.insertCell(1);
          var element1 = document.createElement("input");
          cell1.appendChild(element1);
             element1.name="description"+rowCount;
             element1.align = "center";
             element1.size=30;
  
          var cell2= row.insertCell(2);
          var element2 = document.createElement("input");
          cell2.appendChild(element2);
             element2.name="required"+rowCount;
             element2.align= "center";
             element2.size=5;
  
          var cell3= row.insertCell(3);
          var element3 = document.createElement("input");
          cell3.appendChild(element3);
             element3.name="floor"+rowCount;
             element3.align= "center";
             element3.size=20;
  </code></pre>