![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
13/09/2004, 14:21
|
![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 | |
Adaptado a tus nombres: 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="Unid[]" value="a" onclick="varMarkChk+=(this.checked)?1:-1;">letra a<br>
<input type="checkbox" name="Unid[]" value="s" onclick="varMarkChk+=(this.checked)?1:-1;">letra s<br>
<input type="checkbox" name="Unid[]" value="d" onclick="varMarkChk+=(this.checked)?1:-1;">letra d<br>
<input type="checkbox" name="Unid[]" value="f" onclick="varMarkChk+=(this.checked)?1:-1;">letra f<br>
<input type="checkbox" name="Unid[]" value="g" onclick="varMarkChk+=(this.checked)?1:-1;">letra g<br>
<input type="checkbox" name="Unid[]" value="h" onclick="varMarkChk+=(this.checked)?1:-1;">letra h<br>
<input type="submit">
</form>
</body>
</html>
__________________ Cómo escribir
No hay pregunta tonta, sino tonto que quiere seguir en la ignorancia. |