![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
13/09/2004, 14:18
|
![Avatar de KarlanKas](http://static.forosdelweb.com/customavatars/avatar11549_2.gif) | Moderador extraterrestre | | Fecha de Ingreso: diciembre-2001 Ubicación: Madrid
Mensajes: 6.987
Antigüedad: 23 años, 1 mes Puntos: 61 | |
Y si lo simplificamos con esta tontería: Código HTML: <html>
<head>
<script>
varMarkChk=0;
function comprobar(){
if(varMarkChk<1){
alert("Marque al menos un producto!");
return false;}
}
</script>
</head>
<body>
<form onsubmit="return comprobar()" action="javascript:alert('enviado');">
<input type="checkbox" name="pepe" onclick="varMarkChk+=(this.checked)?1:-1;">
<input type="checkbox" name="pepe2" onclick="varMarkChk+=(this.checked)?1:-1;">
<input type="checkbox" name="pepe3" onclick="varMarkChk+=(this.checked)?1:-1;">
<input type="checkbox" name="pepe4" onclick="varMarkChk+=(this.checked)?1:-1;">
<input type="checkbox" name="pepe5" onclick="varMarkChk+=(this.checked)?1:-1;">
<input type="checkbox" name="pepe6" onclick="varMarkChk+=(this.checked)?1:-1;">
<input type="submit">
</form>
</body>
</html> Te serviría?
__________________ Cómo escribir
No hay pregunta tonta, sino tonto que quiere seguir en la ignorancia. |