Foros del Web » Programando para Internet » Javascript »

seleccionador y pecionar boton

Estas en el tema de seleccionador y pecionar boton en el foro de Javascript en Foros del Web. hola tengo un problema con un codigo que me encontre en una pagina es de los que da clik sobre el y despliega una lista ...
  #1 (permalink)  
Antiguo 08/03/2002, 03:45
Avatar de ivan02  
Fecha de Ingreso: diciembre-2001
Mensajes: 449
Antigüedad: 22 años, 4 meses
Puntos: 2
seleccionador y pecionar boton

hola tengo un problema con un codigo que me encontre en una pagina

es de los que da clik sobre el y despliega una lista de links, despues se oprime el boton go y va hacia la pagina que uno selecciono pero no he podido hacer que funcione alguien tine algun codigo que me pueda pasar o como componer este

saludos

<html>
<head>
<title>titulo</title>
</head>

<body bgcolor="#000080" text="#FFFFFF" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
<font face="arial">
<center><b>Seleccione una Materia</b></center>
<hr>
<form method=post action=./modmats.php>
<center> <font face=arial size=2>
<p><select size=1 name=txtCvem>
<option value=C33></option>
<option value=h48>Filosofía</option>
<option value=X11>Demo</option>
<option value=X33></option>
</select></p><br>
<input type=submit value=GO>
</font> </center>
<input type=hidden name=vpass value=123456>
<input type=hidden name=val value=1>
</form>
</body>

</html>


  #2 (permalink)  
Antiguo 08/03/2002, 16:13
Avatar de jpogsistem  
Fecha de Ingreso: diciembre-2001
Mensajes: 2.405
Antigüedad: 22 años, 4 meses
Puntos: 4
Re: seleccionador y pecionar boton

Para este tipo de menus de salto es mejor utilizar este codigo:


<form>
<select onchange="window.location.href=this.options[selectedIndex].value; this.selectedIndex=0">
<option selected>Links de interés</option>
<option value="http://www.webexperto.com.ar">Web Experto</option>
<option value="http://www.quiquenet.com.ar">Quiquenet</option>
<option value="http://www.alvago.com.ar">Alvago</option>
<option value="javascript:print()">Imprimir esta página</option>
</select>
</form>


Tomado de <a href='ir.asp?http://www.webexperto.com' target='_blank'>http://www.webexperto.com...</a>


  #3 (permalink)  
Antiguo 09/03/2002, 02:25
Avatar de ivan02  
Fecha de Ingreso: diciembre-2001
Mensajes: 449
Antigüedad: 22 años, 4 meses
Puntos: 2
Re: seleccionador y pecionar boton

Muchas gracias

pero necesito el otro de precionar boton por que cuando seleccionas uno si mueves la bolita del raton se confunden no se si alguien lo tenga entre sus curios idades

muchas gracias por el codigo saludos ;)
  #4 (permalink)  
Antiguo 09/03/2002, 08:10
Avatar de jpogsistem  
Fecha de Ingreso: diciembre-2001
Mensajes: 2.405
Antigüedad: 22 años, 4 meses
Puntos: 4
Re: seleccionador y pecionar boton

&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;&gt;
&lt;script language=&quot;JavaScript&quot;&gt;
&lt;!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+&quot;.location='&quot;+selObj.options[selObj.selectedIndex].value+&quot;'&quot;);
if (restore) selObj.selectedIndex=0;
}

function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf(&quot;?&quot;))&gt;0&amp;&amp;pare nt.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&amp;&amp;d.all) x=d.all[n]; for (i=0;!x&amp;&amp;i&lt;d.forms.length;i++) x=d.forms[I][n];
for(i=0;!x&amp;&amp;d.layers&amp;&amp;i&lt;d.layer s.length;i++) x=MM_findObj(n,d.layers.document);
if(!x &amp;&amp; document.getElementById) x=document.getElementById(n); return x;
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}
//--&gt;
&lt;/script&gt;
&lt;/head&gt;

&lt;body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot;&gt;

&lt;table width=&quot;544&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; mm:layoutgroup=&quot;true&quot;&gt;
&lt;tr&gt;
&lt;td width=&quot;190&quot; height=&quot;244&quot;&gt;&lt;/td&gt;
&lt;td width=&quot;354&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height=&quot;63&quot;&gt;&lt;/td&gt;
&lt;td valign=&quot;top&quot;&gt;
&lt;form name=&quot;form1&quot;&gt;
&lt;select name=&quot;menu1&quot; onChange=&quot;MM_jumpMenu('parent',this,0)&quot;& gt;
&lt;option value=&quot;www.mipagina1.com&quot; selected&gt;link1&lt;/option&gt;
&lt;option value=&quot;www.mipàgina2.com&quot;&gt;link2&lt;/option&gt;
&lt;option value=&quot;www.mipagina3.com&quot;&gt;link3&lt;/option&gt;
&lt;/select&gt;
&lt;input type=&quot;button&quot; name=&quot;Button1&quot; value=&quot;Go&quot; onClick=&quot;MM_jumpMenuGo('menu1','parent',0)&qu ot;&gt;
&lt;/form&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;
  #5 (permalink)  
Antiguo 10/03/2002, 02:38
Avatar de ivan02  
Fecha de Ingreso: diciembre-2001
Mensajes: 449
Antigüedad: 22 años, 4 meses
Puntos: 2
Re: seleccionador y pecionar boton

muchas gracias

quisa te sirva este codigo

----- este esun frame de 2 columnas ---
&lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;MORELOS&lt;/TITLE&gt;
&lt;/HEAD&gt;
&lt;FRAMESET cols=&quot;18%,82%&quot; framespacing=&quot;0&quot; border=&quot;0&quot; frameborder=&quot;0&quot;&gt;
&lt;FRAME SRC=&quot;mipagind.html&quot; scrolling=&quot;no&quot; target=&quot;_self&quot;&gt;
&lt;FRAME SRC=&quot;mipagpre.html&quot; NAME=&quot;principal&quot; scrolling=&quot;auto&quot;&gt;
&lt;/FRAMESET&gt;
&lt;/HTML&gt;

--- un codigo parecido al seleccionador pero cambia al frame de la derecha o el que tu quieras ---------

&lt;SCRIPT language=JavaScript&gt;
&lt;!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+&quot;.location='&quot;+selObj.options[selObj.selectedIndex].value+&quot;'&quot;);
if (restore) selObj.selectedIndex=0;
}
//--&gt;
&lt;/SCRIPT&gt;

&lt;STYLE type=text/css&gt;.jumpcolors {
BACKGROUND-COLOR: #000000; COLOR: #999999; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 9pt
}
&lt;/STYLE&gt;

&lt;title&gt;Pagina nueva 1&lt;/title&gt;
&lt;/head&gt;


&lt;FORM name=archive&gt;
&lt;p align=&quot;left&quot;&gt; &lt;SELECT class=jumpcolors
onchange=&quot;MM_jumpMenu('parent.frames[\'principal\']',this,0)&quot;&gt; &lt;OPTION
selected value=mipagpre.html&gt;INICIO:&lt;/OPTION&gt; &lt;OPTION
value=h_trueba.htm&gt;Trueba&lt;/OPTION&gt; &lt;OPTION
value=h_casa_real.htm&gt;Casa real&lt;/OPTION&gt; &lt;OPTION
value=h_lorve.htm&gt;Lorve&lt;/OPTION&gt; &lt;OPTION
value=h_las_fuentes.htm&gt;Las fuentes&lt;/OPTION&gt; &lt;OPTION
value=h_pluviosilla.htm&gt;Pluviosilla&lt;/OPTION&gt;
&lt;/SELECT&gt; &lt;/FORM&gt;
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 09:27.