Hi,
I am having a jsp which has multiple check boxes with the same Name. I am trying to figure out which check boxes are checked.
<%int iVal = 2;
while(it.hasNext()){
String key = (String)it.next(); %>
<tr>
<td>
<label><%=(String)map.get(key)%></label>
</td>
<td>
<input type="checkbox" name="delCheckBox" value=""con" + <%=iVal%>">
</td>
</tr>
<%iVal++; }%>
This is what I am trying to do to get the values:
String [] cb = request.getServletRequest().getParameterValues("delCheckBox");
if(cb == null) cb = new String[]{};
if(cb!=null) {
for (int i = 0; i < cb.length; i++) {
response.write(cb);
response.write(" ");
}
}
When I check 4 check boxes in the html page, I am able to get the cb.length = 4.
But how do I get the contents of this string array?
Thanks,
Rishi