title: Accessing specific member of an ArrayList using Javascript
body: <p>So, I have a table in a jsp page which shows the data fetched from a database via an ArrayList forwarded to the page. Each row of the table has a radio button corressponding to it. Now, I would like to access the elements in the row (the ArrayList's members on the selection of the corresponding radio button and then click of an 'edit' button)
  Any thoughts as to how to achieve this would be very much appreciated. Here's my code for a bit intro.</p>
  
  <pre><code>&lt;% 
     ArrayList&lt;requestbean&gt; reqjsp = new ArrayList&lt;requestbean&gt;();
     reqjsp = (ArrayList&lt;requestbean&gt;) (request.getAttribute("reqdb"));
  %&gt;
  
  &lt;script type ="text/javascript"&gt;
     function x() {
        var ele = document.getElementsByName('reqradio');
        var i = ele.length;
        for ( var j = 0; j &lt; i; j++ ) {
           if ( ele[j].checked ) {
               document.getElementById("edireq").disabled = false;
               alert('request ' + ( j + 1 ) + ' selected');
               //Here is where the functionality is desired to access reqjsp.get(j)
          }      
       }
    }
  &lt;/script&gt; 
  &lt;input type="button" name="edireq" id="edireq" onclick="x()" value="Edit Request"&gt;
  </code></pre>
  
  <p>These are a few columns in my table.</p>
  
  <pre><code>&lt;%
   for ( int i = 0; i &lt; reqjsp.size(); i++ ) {
  %&gt;
    &lt;tr&gt; 
      &lt;td&gt; &lt;input type="radio" name="reqradio" id="req&lt;%=(i+1) %&gt;"&gt;&lt;/td&gt; 
      &lt;td&gt;&lt;%= reqjsp.get(i).getRequestid() %&gt;&lt;/td&gt;            
      &lt;td&gt;&lt;%= reqjsp.get(i).getRequestor() %&gt;&lt;/td&gt;  
      &lt;td&gt;&lt;%= reqjsp.get(i).getApprover() %&gt;&lt;/td&gt;              
    &lt;/tr&gt; 
  &lt;%} %&gt;
  </code></pre>