Ver Mensaje Individual
  #4 (permalink)  
Antiguo 21/10/2005, 14:04
Avatar de programeitor
programeitor
 
Fecha de Ingreso: febrero-2005
Mensajes: 994
Antigüedad: 19 años, 2 meses
Puntos: 9
seleccionar opcion de un select segun se escribe en un campo de texto

<!DOCTYPE HTML PUBLIC><html><head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title>
seleccionar opcion de un select segun se escribe en un campo de texto
</title><script>
var opn=0;
function selecciona(busqueda)
{
var op=[]
op.s=document.getElementById('sel').options;
op.c=busqueda;
op.l=op.c.length;
for(n=0;n<op.s.length;n++)
{
op.t=op.s[n].value.substring(0,op.l);
if(op.c==op.t)
{
op.s[opn].selected=false;
op.s[n].selected=true;
opn=n;
}
}
}
</script></head><body onload="selecciona('casa');">
<select id="sel"multiple>
<option value="ahora">ahora
<option value="bacalao">bacalao
<option value="becerro">becerro
<option value="casa">casa
</select>
<input type="text" onkeyup="selecciona(this.value)">
</body></html>
<!-- programeitor 2005 -->