Ver Mensaje Individual
  #8 (permalink)  
Antiguo 29/06/2004, 08:25
Avatar de RootK
RootK
Moderador
 
Fecha de Ingreso: febrero-2002
Ubicación: México D.F
Mensajes: 8.004
Antigüedad: 22 años, 3 meses
Puntos: 50
El link de sindestino está muy claro friend.. pero si no lo entiendes de todas formas te lo paso. (aunque recuerda que hay que siempre buscar la forma...y no esperar a que hagan todo por nosotros ok.. ??) Solo haz copy and paste.. ya funciona bien...


en modo html

Ejemplo.aspx
Cita:
<HTML>
<HEAD>
<title>WebForm3</title>
<SCRIPT LANGUAGE="javascript">
function doSelectChange(el,dest) {
dest.value = el.options[el.selectedIndex].text
}
function lookupItem(el,dest) {
var curValue = el.value.toLowerCase()
var found = false;
var index = dest.selectedIndex;
var numOptions = dest.options.length;
var pos = 0;
// Repeat until found or end of list is reached
while ((!found) && (pos < numOptions)) {
// Do comparisons in lowercase
found = (dest.options[pos].text.toLowerCase().indexOf(curValue)==0)
if (found)
index = pos;
pos++;
}
if (found) // Updated listbox
dest.selectedIndex = index;
}

function goValue(el) {
var where;
if (el.selectedIndex > -1) {
// Make sure there is a selection
where = el.options[el.selectedIndex].value;
window.open(where)
}
}


</SCRIPT>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<P>
<asp:textbox id="textInput" runat="server"></asp:textbox></P>
<P>
<asp:ListBox id="selectInput" runat="server" Width="184px" Height="112px">
<asp:ListItem Value="1">Uno</asp:ListItem>
<asp:ListItem Value="2">dOS</asp:ListItem>
<asp:ListItem Value="3">Tres</asp:ListItem>
<asp:ListItem Value="4">Cuatro</asp:ListItem>
<asp:ListItem Value="5">Enero</asp:ListItem>
</asp:ListBox></P>
</SPAN>
</form>
</FORM>
</body>
</HTML>
Ejemplo.aspx.vb

Cita:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
textInput.Attributes.Add("ONKEYUP", "lookupItem(this,this.form.selectInput)")
selectInput.Attributes.Add("ONCHANGE", "doSelectChange(this, this.form.textInput)")
End If

End Sub
Salu2 y espero te sirva...
__________________
Nadie roba nada ya que en la vida todo se paga . . .

Exentrit - Soluciones SharePoint & Net