Ver Mensaje Individual
  #4 (permalink)  
Antiguo 05/05/2012, 22:41
Avatar de BLAH !!
BLAH !!
 
Fecha de Ingreso: septiembre-2003
Ubicación: Región Metropolitana, Santiago, Chile
Mensajes: 706
Antigüedad: 20 años, 7 meses
Puntos: 16
Respuesta: Autocompletar formulario de acuerdo a BD

GLORIOSO
ajax.responseText; !!!!

este es el codigo que tengo ... ahora como lo hago para mas variables ?
Como le doy arrays a ajax.responseText; ???

index.php
Código PHP:
...
<
input type="text" onBlur="completar(this.value)">
... 
load-ajax.js
Código:
function nuevoAjax()
{ 
	var xmlhttp=false; 
	try 
	{ 
		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
	}
	catch(e)
	{ 
		try
		{ 
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
		} 
		catch(E) { xmlhttp=false; }
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp=new XMLHttpRequest(); } 

	return xmlhttp; 
} 

function completar(R)
{
 var ajax=nuevoAjax();
 ajax.open("GET", "AJAX/load-carga.php?valor="+R, false);
 ajax.send(null);
 document.getElementById('valor1').value=ajax.responseText;
}
load-carga.php
Código PHP:
<?php
$ide
=trim($_GET['valor']); 
require(
"BDconecta.php");

$sql mysql_query("SELECT * FROM table WHERE valor='$ide'") or die (mysql_error());
$rowmysql_fetch_assoc($sql);

echo 
"".$row['valor1']."";
?>
__________________
Adios ...!!!!