Men ya tengo el autocomplete.
Sigues sin entenderme quiero que el valor que se manda sea de un textbox pero no se como cachar ese valor cuando viene de un textbox, logre cacharlo con un select pero la idea es que sea con un textbox en esta parte del codigo.
Código Javascript
:
Ver original//fucion con la cual obtenemos los datos
function obten_datos(arrastre,destino,destino2,destino3,destino4)
{
//alert("arrastre: "+arrastre+" destino: "+destino+" destino2: "+destino2+" destino3: "+destino3);
destino = document.getElementById(destino);
destino2 = document.getElementById(destino2);
destino3 = document.getElementById(destino3);
destino4 = document.getElementById(destino4);
LimpiarInput(destino);
LimpiarInput(destino2);
LimpiarInput(destino3);
LimpiarInput(destino4);
if(arrastre.options[arrastre.selectedIndex].value != 0)
{
arrastre.disabled = true;
destino.disabled = true;
destino.value = 'Cargando Nombre....';
destino2.disabled = true;
destino2.value = 'Cargando ap paterno....';
destino3.disabled = true;
destino3.value = 'Cargando ap materno....';
destino4.disabled = true;
destino4.value = 'Cargando correo....';
$.ajax({
type: 'get',
dataType: 'text',
url: 'obtenerdatos.php',
data: {valor: arrastre.options[arrastre.selectedIndex].value},
success: function(text){
LlenarDatos(text,destino,destino2,destino3,destino4);
arrastre.disabled = false;
destino.disabled = true;
destino.readOnly = true;
destino2.disabled = true;
destino2.readOnly = true;
destino3.disabled = true;
destino3.readOnly = true;
destino4.disabled = true;
destino4.readOnly = true;
}
});
}
}
pienso que puede ser
arrastre = document.getElementById(arrastre);
if(arrastre.value != "")
data: {valor: arrastre.value},