Ver Mensaje Individual
  #8 (permalink)  
Antiguo 13/09/2010, 19:14
Avatar de zerokilled
zerokilled
Javascripter
 
Fecha de Ingreso: abril-2009
Ubicación: Isla del Encanto, La Borinqueña [+>==]
Mensajes: 8.050
Antigüedad: 15 años
Puntos: 1485
Respuesta: datos marcados en un checkbox al volver de otra paguina

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. en este codigo, en lugar de devolver un mensaje, simplemente no deja marcar el checkbox.
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>
__________________
la maldad es una virtud humana,
y la espiritualidad es la lucha del hombre contra su maldad.