Duvida JSP check box

0 respostas
P

Bom tenho uma pagina de teste onde tenho 10 checkbox
quando o usuario seleciona uma lista tipo checkbox 2,4,6,8
e tendo manter na sessao os checkbox marcados so consegui manter um ultimo que no caso e o 8.
O problema e esse sera que alguem tem alguma manha ai..

valeu pessoal....

o codigo e o seguinte
<%@page contentType="text/html"%>




<%  
	response.setDateHeader("Expires", 0);
    response.setHeader("Pragma", "no-cache");
    response.setHeader("Cache-Control", "no-cache");
%>

<form name='form' action='/sisgea/teste.jsp'>
<table>
 <tr>
<% 	String [] checks = ((request.getParameterValues("check") != null )? request.getParameterValues("check") : null ) ; %>
<%  String valorCheck = "" ;
 for( int i=0; i < 10; i++){%>
	  <% valorCheck = ((checks != null && checks.length > i )? checks[i] : valorCheck );%>
 	   <td align="center"><input type="checkbox" name="check" value='<%=i%>' <%=((valorCheck.equalsIgnoreCase(String.valueOf(i)) )? "checked" : "" )%> ></td>
	<%System.out.println("o valor da variavel = " + valorCheck);%>
	<%}%>

 </tr>
 <tr>
 <td><input type='submit'name="ok" value="ok" ></td>
 </tr>
</table>
<table>
<tr>
	<td>Dias Selecionados</td>
    <%if( checks != null) {
    	for(int i=0; i < checks.length ; i++) {%>
    		<td><%=Integer.parseInt(checks[i]) + 1%></td>
    	<%} }%>
</tr>

</table>
</form>
Criado 12 de outubro de 2004
Respostas 0
Participantes 1