Ver Mensaje Individual
  #2 (permalink)  
Antiguo 10/11/2005, 17:46
angsanchez
 
Fecha de Ingreso: octubre-2004
Ubicación: España
Mensajes: 894
Antigüedad: 19 años, 7 meses
Puntos: 3
Hola, canela2

Seguramente hay una solución más elegante, pero lo fácil es usar una función que evalúe el checkbox y defina el enlace.
Aunque me temo que lo que necesitas no es un checkbox, sino un radio:
Código HTML:
<head>
<script type="text/javascript">
function dirige()
{
	var destinos = ["www.google.es", "www.yahoo.es", "www.elpais.es"]
	var ctl = document.forms.eligiendo.radio2
	for (i=0; ctl.length; i++)
	{	if (ctl[i].checked) { location.href =  "http://" + destinos[i]; break }
	}
}
</script>
</head>
<body>
<form name="eligiendo">
<input type="radio" name="radio2">A
<input type="radio" name="radio2">B
<input type="radio" name="radio2">C
<br><a href="javascript:dirige()">Enlace</a>
</form>
</body> 
Otra forma:
Código HTML:
<head>
<script type="text/javascript">
function dirige()
{
	var ctl = document.forms.eligiendo.radio2
	for (i=0; ctl.length; i++)
	{	if (ctl[i].checked) { location.href = ctl[i].value; break }
	}
}
</script>
</head>
<body>
<form name="eligiendo">
<input type="radio" name="radio2" value="http://www.google.es">A
<input type="radio" name="radio2" value="http://www.yahoo.es">B
<input type="radio" name="radio2" value="http://www.elpais.es">C
<br><a href="javascript:dirige()">Enlace</a>
</form>
</body> 
__________________
Angel :cool: