Ver Mensaje Individual
  #5 (permalink)  
Antiguo 18/02/2005, 07:46
pepe_lalo11
 
Fecha de Ingreso: noviembre-2003
Ubicación: CHile, 8 Region
Mensajes: 68
Antigüedad: 20 años, 6 meses
Puntos: 0
Gracias xknown, el ejemplo me sirvio a la perfeccion ... aca le dejo el codigo que me resulto.

<form id="form" method="post" runat="server">
<asp:DropDownList id="options" style="Z-INDEX: 104; LEFT: 240px; POSITION: absolute; TOP: 224px" runat="server" Height="24px" Width="248px" onChange="this.form.input1.value=this.options[this.selectedIndex].value">
<asp:ListItem Value="Barcelona">Barcelona</asp:ListItem>
<asp:ListItem Value="Madrid">Madrid</asp:ListItem>
<asp:ListItem Value="Valencia">Antofagasta</asp:ListItem>
<asp:ListItem Value="Mallorca">Arica</asp:ListItem>
<asp:ListItem Value="Villarreal">Chillan</asp:ListItem>
</asp:ListItem>
</asp:DropDownList>
<INPUT onkeyup="autoComplete(this,this.form.options,'valu e',true)" style="Z-INDEX: 103; LEFT: 80px; WIDTH: 144px; POSITION: absolute; TOP: 224px; HEIGHT: 22px" type="text" size="18" name="input1">

La Funcion Script es la siguiente:
function autoComplete (field, select, property, forcematch) {
var found = false;
for (var i = 0; i < select.options.length; i++) {
if (select.options[i][property].toUpperCase().indexOf(field.value.toUpperCase()) == 0) {
found=true; break;
}
}
if (found) { select.selectedIndex = i; }
else { select.selectedIndex = -1; }
if (field.createTextRange) {
if (forcematch && !found) {
field.value=field.value.substring(0,field.value.le ngth-1);
return;
}
var cursorKeys ="8;46;37;38;39;40;33;34;35;36;45;";
if (cursorKeys.indexOf(event.keyCode+";") == -1) {
var r1 = field.createTextRange();
var oldValue = r1.text;
var newValue = found ? select.options[i][property] : oldValue;
if (newValue != field.value) {
field.value = newValue;
var rNew = field.createTextRange();
rNew.moveStart('character', oldValue.length) ;
rNew.select();
}
}
}
}

Saludos
__________________
Around The World