Ver Mensaje Individual
  #2 (permalink)  
Antiguo 24/09/2004, 17:11
Avatar de Saruman
Saruman
 
Fecha de Ingreso: mayo-2003
Ubicación: Panama city, Panama, Panama
Mensajes: 1.154
Antigüedad: 21 años, 9 meses
Puntos: 5
hola, aqui esta este ejemplito:

Código HTML:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<script language="javascript">
	function validar() {
		var f = document.form1
		var sw = false;
		
		for (i=0; i < f.checkbox.length; i++) {
			if (f.checkbox[i].checked == true) {
				sw = true;
			}
		}
		
		if (sw == false) {
			alert("No has seleccionado ningun checkbox!!!")
			return false
		}
		
		return true
	}
</script>

<body>
<form name="form1" method="post" action="" onSubmit="return validar()">
  <input type="checkbox" name="checkbox" value="1">
  <input type="checkbox" name="checkbox" value="2">
  <input type="checkbox" name="checkbox" value="3">
  <input type="checkbox" name="checkbox" value="4">
  <input type="checkbox" name="checkbox" value="5">
  <input type="checkbox" name="checkbox" value="6">
  <input type="submit" name="Submit" value="Submit">
</form>
</body>
</html> 
__________________
Saruman

One Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them.