I have this kind of table, it has many rows and each row has two columns, first column has a text and second column has list of checkboxes for each row. I was able to retrieve the values of fist column but not the values of selected checkboxes for each colunm.
I have used var cellval=Table.rows[i].cells[0].firstChild.data in a “for” loop in the Java Script to get the first column values, but how can I get the selected checkbox values for each row inside this for loop? (I need to map for each 1st cell value what are the selected checkbox values in the 2nd cell)
<tbody>
<% List data = (List) request.getAttribute("fiboterm");%>
<%int i=0;%>
<c:forEach var="row" items="${PhraseScoreList}">
<tr>
<td width="75%">${row.phraseContent}</td>
<td width="25%">
<div style="overflow: auto; width: 200px; height: 75px; border: 1px solid #336699; padding-left: 5px">
<%Iterator itr;%>
<%
for( int j=0;j<data.size(); j++){
%>
<input type="checkbox" name="nums<%=i%>" id="chk[<%=i%>]" value="<%=data.get(j)%>"> <%=data.get(j)%><br>
<%}
i++;
%>
</div>
</td>
</tr>
</c:forEach>
</tbody>
you are mixing code and html.
1)consider using serlvlet and jsp and a dao. i.e simple MVC architecture.
get checkbox values from the Servlet in a loop using this kind of statement
2) otherwise i suggest you try this out by using jquery library;