Ver Mensaje Individual
  #6 (permalink)  
Antiguo 19/01/2007, 08:50
Moleman
 
Fecha de Ingreso: abril-2006
Mensajes: 69
Antigüedad: 19 años, 1 mes
Puntos: 0
Re: Problema al intentar recuperar el valor de un checkbox.

Pues ya está, ya me ha salido... ¡por fin!

Dejo por aquí el código por si alguien lo quiere usar:

BB.DD. ACCESS

Crear un campo de nombre casilla_verificacion y asignarle un valor numérico de "entero".

PÁGINA 1: FORMULARIO

<input type="checkbox" name="wcasilla_verificacion" value="True">

PÁGINA 2: INSERTAR VALORES DEL FORMULARIO EN LA BB.DD.

if request.form("wcasilla_verificacion") = "True" then
xcasilla_verificacion = 1
else
xcasilla_verificacion = 0
end if

<%
sSQL="Insert Into tabla (casilla_verificacion) values ('" & xcasilla_verificacion & "')"
%>

PÁGINA 3: RECUPERAR FORMULARIO CON DATOS

<% if rs("cambios01_2006") = "1" then
response.write ("<input type='checkbox' name='wcasilla_verificacion' value='True' checked>")
else
response.write ("<input type='checkbox' name='wcasilla_verificacion' value='True'>")
end if
%>

PÁGINA 4: INSERTAR NUEVOS VALORES

if request.form("wcasilla_verificacion") = "True" then
xcasilla_verificacion = 1
else
xcasilla_verificacion = 0
end if

<%
sSQL="Insert Into tabla (casilla_verificacion) values ('" & xcasilla_verificacion & "')"
%>

Bueno, creo que con esto ya está todo. Me ha costado un montón, pero lo he conseguido... ¡menuda sensación de triunfo se queda, ¿verdad?!

Si alguien puede aprovechar el código, garantizo que funciona, tal cual lo he escrito.

Un saludo y gracias a daniel00 y u_goldman.

Moleman.