title: How to dynamically add Date in a form using JavaScript?
body: <p>I have this form code to dynamically add rows. How can I add a date dynamically?</p>
  
  <pre><code>&lt;HTML&gt;
  &lt;HEAD&gt;
      &lt;TITLE&gt; Add/Remove dynamic rows in HTML table &lt;/TITLE&gt;
      &lt;SCRIPT language="javascript"&gt;
          function addRow(tableID) {
  
              var table = document.getElementById(tableID);
  
              var rowCount = table.rows.length;
              var row = table.insertRow(rowCount);
  
              var cell1 = row.insertCell(0);
              var element1 = document.createElement("input");
              element1.type = "checkbox";
              cell1.appendChild(element1);
  
              var cell2 = row.insertCell(1);
              cell2.innerHTML = rowCount + 1;
  
              var cell3 = row.insertCell(2);
              var element2 = document.createElement("input");
              element2.type = "text";
              cell3.appendChild(element2);
  
          }
  
          function deleteRow(tableID) {
              try {
              var table = document.getElementById(tableID);
              var rowCount = table.rows.length;
  
              for(var i=0; i&lt;rowCount; i++) {
                  var row = table.rows[i];
                  var chkbox = row.cells[0].childNodes[0];
                  if(null != chkbox &amp;&amp; true == chkbox.checked) {
                      table.deleteRow(i);
                      rowCount--;
                      i--;
                  }
  
              }
              }catch(e) {
                  alert(e);
              }
          }
  
      &lt;/SCRIPT&gt;
  &lt;/HEAD&gt;
  &lt;BODY&gt;
  
      &lt;INPUT type="button" value="Add Row" onclick="addRow('dataTable')" /&gt;
  
      &lt;INPUT type="button" value="Delete Row" onclick="deleteRow('dataTable')" /&gt;
  
      &lt;TABLE id="dataTable" width="350px" border="1"&gt;
          &lt;TR&gt;
              &lt;TD&gt;&lt;INPUT type="checkbox" name="chk"/&gt;&lt;/TD&gt;
              &lt;TD&gt; 1 &lt;/TD&gt;
              &lt;TD&gt; &lt;INPUT type="text" /&gt; &lt;/TD&gt;
          &lt;/TR&gt;
      &lt;/TABLE&gt;
  
  &lt;/BODY&gt;
  &lt;/HTML&gt;
  </code></pre>
  
  <p>This the code for adding row dynamically</p>
  
  <p>This is the code for calendar</p>
  
  <pre><code>&lt;script language="JavaScript" src="calendar_us.js"&gt;&lt;/script&gt;
      &lt;link rel="stylesheet" href="calendar.css"&gt;
  
  &lt;INPUT type="text" name="testinput" /&gt; 
  &lt;script language="JavaScript"&gt;
  
      new tcal ({
  
          // form name
  
          'formname': 'testform',
  
          // input name
  
          'controlname': 'testinput'
      });
  
      &lt;/script&gt;
  </code></pre>