title: Generate dynamic table along with dynamic radio button to further generate dynamic table in JSP
body: <p>I have so far created a page that generates a dynamic table with data getting populated from database via entering a text in a text box. How can I now generate a radio button along with each row in a table that is dynamically generating.</p>
  
  <pre><code>&lt;select id='two' name="info"&gt;
                  &lt;option value="m"&gt;M&lt;/option&gt;
                  &lt;option value="h"&gt;H&lt;/option&gt;
              &lt;/select&gt;
  
              &lt;input type="text" name="dynamicText"&gt;
              &lt;input type="submit" value="Submit Query"&gt;
          &lt;/form&gt;
  
  
   &lt;TABLE BORDER="1" CELLPADDING="1" CELLSPACING="1" style="text-align: center;"&gt;
          &lt;TR&gt;
              &lt;TH&gt;Ap&lt;/TH&gt;
              &lt;TH&gt;M&lt;/TH&gt;
              &lt;TH&gt;V&lt;/TH&gt;
          &lt;/TR&gt;
  
          &lt;c:forEach var="i" begin="0" end="${Data.getH().size() - 1}"&gt;
              &lt;TR&gt;
                  &lt;TD&gt;
                          ${Data.getH().get(i)}
                  &lt;/TD&gt;
                  &lt;TD&gt;
                          ${Data.getM().get(i)}
                  &lt;/TD&gt;
                  &lt;TD&gt;
                          ${Data.getV().get(i)}
                  &lt;/TD&gt;
                       &lt;/TR&gt;
          &lt;/c:forEach&gt;
      &lt;/TABLE&gt;
  </code></pre>
  
  <p>In javascript we do have </p>
  
  <pre><code>  var newRadio = document.createElement("input");
    newRadio.type='radio';
  </code></pre>
  
  <p>But I am not getting how can I generate the radio buttons dynamically in front of dynamic table that is being generated already?</p>
  
  <p>Any help would be really appreciated. Also please let me know if anything else is needed from my part.</p>
  
  <p><strong>[Edit]</strong> : Later I needed to select that Radio Button and generate another dynamic table,  that has data coming from database.</p>
  
  <p>For example,</p>
  
  <pre><code>  Headers/column name:  Radio button  || Ap   || M        ||    V    ||
                          Radio Button 1||  rtyy || valueM   || valueV
                           .
                           .
                           .
                           .
  </code></pre>
  
  <p>If radio button 1 is selected, then it should pick that row and value of column "Ap" which is "rtyy" and query from database with that value and generate a dynamic table further.</p>
  
  <p>I have made a connection and have the query already, but in order to generate another table with dynamic value from a table, I am lacking.</p>
  
  <blockquote>
    <p>Do I need to create a simple onclick function and place in 
    in javascript to generate the table? and if yes, how can I achieve the
    dynamic value that is in the first column of previous table?</p>
  </blockquote>