Ver Mensaje Individual
  #4 (permalink)  
Antiguo 26/01/2009, 03:19
quimfv
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Sabadell
Mensajes: 4.897
Antigüedad: 16 años, 1 mes
Puntos: 574
Respuesta: select que on change cambie de html

Que rápidos son... estaba elaborando una respusta con varias opciones...

Quim

Código HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Documento sin t&iacute;tulo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<script language="JavaScript" type="text/JavaScript">
function redirige(obj){
	var opcion=obj[obj.selectedIndex].value;
	if (opcion!=0){
		switch (opcion){
			case "1":
			    document.location.href="html1.html";
			break;
			case "2":
			    document.location.href="html2.html";
			break;
			case "3":
			    document.location.href="html3.html";
			break;
			case "4":
			    document.location.href="html4.html";
			break;
		}
	}
}
function redirige2(obj){
	var opcion=obj[obj.selectedIndex].value;
	if (opcion!=0){
		switch (opcion){
			case "1":
			    window.open("html1.html",'mywin','left=20,top=20,width=500,height=500,toolbar=1,resizable=0');
			break;
			case "2":
			    window.open("html2.html",'mywin','left=20,top=20,width=500,height=500,toolbar=1,resizable=0');
			break;
			case "3":
			    window.open("html3.html",'mywin','left=20,top=20,width=500,height=500,toolbar=1,resizable=0');
			break;
			case "4":
			    window.open("html4.html",'mywin','left=20,top=20,width=500,height=500,toolbar=1,resizable=0');
			break;
		}
	}
}
function redirige3(obj){
	var opcion=obj[obj.selectedIndex].value;
	if (opcion!=0){
		switch (opcion){
			case "1":
			    window.open("html1.html",'mywin'+opcion,'left=20,top=20,width=500,height=500,toolbar=1,resizable=0');
			break;
			case "2":
			    window.open("html2.html",'mywin'+opcion,'left=20,top=20,width=500,height=500,toolbar=1,resizable=0');
			break;
			case "3":
			    window.open("html3.html",'mywin'+opcion,'left=20,top=20,width=500,height=500,toolbar=1,resizable=0');
			break;
			case "4":
			    window.open("html4.html",'mywin'+opcion,'left=20,top=20,width=500,height=500,toolbar=1,resizable=0');
			break;
		}
	}
}
</script>
<body>
A la misma ventana <select name="select" id="select" onChange="redirige(this)">
<option value="0">Elige una</option>
<option value="1">001</option>
<option value="2">002</option>
<option value="3">003</option>
<option value="4">004</option>
</select>
<br>
A una ventana nueva <select name="select2" id="select2" onChange="redirige2(this)">
<option value="0">Elige una</option>
<option value="1">001</option>
<option value="2">002</option>
<option value="3">003</option>
<option value="4">004</option>
</select>
<br>
A muchas ventanas nuevas <select name="select2" id="select2" onChange="redirige3(this)">
<option value="0">Elige una</option>
<option value="1">001</option>
<option value="2">002</option>
<option value="3">003</option>
<option value="4">004</option>
</select>
</body>
</html>