
26/10/2007, 04:26
|
| | Fecha de Ingreso: mayo-2005
Mensajes: 74
Antigüedad: 19 años, 11 meses Puntos: 2 | |
Re: Guardar Check box seleccionado Para meter el valor de un check seleccionado, tiene que haber "una ida y venida" al servidor...para crear la variable de session...te pongo un ejemplo sencillo, este ejemplo, cuando se pulsa el check, se envia el formulario y crea la variable de session, despues se pinta el check dependiendo del valor de esa variable.
<%
if (Request.Form <> "") then
if (Request.Form("micheck")<> "") then
Session("pulsoelCheck") = true
else
Session("pulsoelCheck") = false
end if
end if
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin título</title>
</head>
<body>
<form name="frm" action="miPagina.asp" method="post">
<% if (Session("pulsoelCheck")) then %>
<input type="checkbox" value="valorCheck" name="micheck" onclick="javascript:window.location='miPagina.asp' ;" checked="checked"/>
<% else %>
<input type="checkbox" name="micheck" onclick="javascript:document.frm.submit();"/>
<% end if %>
</form>
</body>
</html> |