Foros del Web » Programando para Internet » Javascript »

Select con enlace a nueva página

Estas en el tema de Select con enlace a nueva página en el foro de Javascript en Foros del Web. Estoy armando una página que tiene infinidad de respuestas a probables preguntas de los clientes. Si bien la he dejado bastante ordenada es un tanto ...
  #1 (permalink)  
Antiguo 20/09/2004, 14:00
Avatar de cmarti  
Fecha de Ingreso: noviembre-2003
Ubicación: Buenos Aires - Argentina
Mensajes: 442
Antigüedad: 20 años, 5 meses
Puntos: 1
Select con enlace a nueva página

Estoy armando una página que tiene infinidad de respuestas a probables preguntas de los clientes. Si bien la he dejado bastante ordenada es un tanto larga y no veo que eso sea práctico motivo por el cual he pensado en un sencillo select y que el cliente al elejir una opción se abra una nueva ventana con las respuestas precisas a esa pregunta.
Serían tan amables de enseñarme cómo lo hago?
M Gs.
  #2 (permalink)  
Antiguo 20/09/2004, 15:23
Avatar de Saruman  
Fecha de Ingreso: mayo-2003
Ubicación: Panama city, Panama, Panama
Mensajes: 1.154
Antigüedad: 20 años, 11 meses
Puntos: 5
<script language="javascript">
function abrir_popup(pagina) {
window.open(pagina, "popup", "");
}
</script>

<select name="select" onChange="abrir_popup(this.value)">
<option value="pagina1.html">ver este link</option>
<option value="pagina2.html">ver este link</option>
<option value="pagina3.html">ver este link</option>
<option value="pagina4.html">ver este link</option>
</select>
__________________
Saruman

One Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them.
  #3 (permalink)  
Antiguo 23/09/2004, 12:07
Avatar de cmarti  
Fecha de Ingreso: noviembre-2003
Ubicación: Buenos Aires - Argentina
Mensajes: 442
Antigüedad: 20 años, 5 meses
Puntos: 1
Enlaces de un Select a un frame determinado

Saruman. Funciona perfectamente. Solo me resta preguntar cómo hago si las páginas a las cuales vinculo se ejecutan dentro de un frame.
Gs. de antemando
  #4 (permalink)  
Antiguo 24/09/2004, 16:59
Avatar de Saruman  
Fecha de Ingreso: mayo-2003
Ubicación: Panama city, Panama, Panama
Mensajes: 1.154
Antigüedad: 20 años, 11 meses
Puntos: 5
ok, aqui esta lo que pediste en frames. espero te sirva.

index.html

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

<frameset rows="*" cols="169,*" framespacing="0" frameborder="NO" border="0">
  <frame src="menu.html" scrolling="NO" noresize>
  <frame src="default1.html" name="principal">
</frameset>
<noframes><body>
</body></noframes>
</html> 

menu.html

Código HTML:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function abrir_popup(pagina) {
	top.principal.location.href = pagina
}
//-->
</script>
</head>

<body>

<strong>modo1</strong><br>

<select name="select">
	<option value="default1.html">ver link 1</option>
	<option value="default2.html">ver link 2</option>
	<option value="default3.html">ver link 3</option>
</select>

<input type="button" name="Button" value="VER" onClick="abrir_popup(document.all.select.value)">

<br><br>
<strong>modo2</strong>
<form name="form1">
  <select name="menu1" onChange="MM_jumpMenu('parent.principal',this,0)">
    <option value="default1.html">ver link 1</option>
	<option value="default2.html">ver link 2</option>
	<option value="default3.html">ver link 3</option>
  </select>
</form>
<br>
<strong>modo3</strong><br>
<a href="default1.html" target="principal">opcion1</a><br>
<a href="default2.html" target="principal">opcion2</a><br>
<a href="default3.html" target="principal">opcion3</a>

</body>
</html> 

default1.html

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

<body>
 texto de opcion 1 
</body>
</html> 
default2.html

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

<body>
 texto de opcion 2 
</body>
</html> 
default3.html

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

<body>
 texto de opcion 3
</body>
</html> 

ok, saludos
__________________
Saruman

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

Última edición por Saruman; 24/09/2004 a las 17:02
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 01:53.