Ver Mensaje Individual
  #9 (permalink)  
Antiguo 13/09/2010, 19:19
churretin
 
Fecha de Ingreso: abril-2010
Ubicación: Extremadura
Mensajes: 128
Antigüedad: 14 años
Puntos: 2
Respuesta: datos marcados en un checkbox al volver de otra paguina

Cita:
Iniciado por zerokilled Ver Mensaje
no se a que exactamente te refieres cuando dices coger el numero de datos de la BD, pero no creo que te haga falta siempre y cuando puedas identificar todos los checkboxes desde javascript. a continuacion un ejemplo.
Código:
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Test Development</title>
<script type='text/javascript'>
// asignar los eventos cuando cargue el documento;
self.onload = function(){
for(var checks = document.getElementsByName("check[]"), max = 3, i = 0; checks[i]; i++) checks[i].onclick = function(){
for(var count = 0, i = 0; checks[i]; i++) if(checks[i].checked) count++;
return count <= max;
}};
</script>
<style type='text/css'>

</style>
</head>

<body>
<input type="checkbox" name="check[]" />
<input type="checkbox" name="check[]" />
<input type="checkbox" name="check[]" />
<input type="checkbox" name="check[]" />
<input type="checkbox" name="check[]" />
</body></html>

tienes razon cuano me puesto hacerlo me dao cuenta k es mas facil asi, gracias por tu timepo