Hola nuevamente, despues de pelear mucho encontre una manera de resolver mi problema, ahora me resta una cosita mas, necesito llenar dos textbox y no se como hacerlo.
Aca el codigo:
Archivo html
Código HTML:
Ver original// Developed by Roshan Bhattarai
// Visit http://roshanbh.com.np for this script and more.
// This notice MUST stay intact for legal use
//fuction to return the xml http object
function getXMLHTTP() {
var xmlhttp=false;
try{
xmlhttp=new XMLHttpRequest();
}
catch(e) {
try{
xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e){
try{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e1){
xmlhttp=false;
}
}
}
return xmlhttp;
}
function getCurrencyCode(strURL)
{
var req = getXMLHTTP();
if (req)
{
//function to be called when state is changed
req.onreadystatechange = function()
{
//when state is completed i.e 4
if (req.readyState == 4)
{
// only if http status is "OK"
if (req.status == 200)
{
document.getElementById('cur_code').value=req.responseText;
}
else
{
alert("There was a problem while using XMLHTTP:\n" + req.statusText);
}
}
}
req.open("GET", strURL, true);
req.send(null);
}
}
<form name="form1" id="form1">
<select id="nombre" name="nombre" onChange="getCurrencyCode('find_ccode.php?nombre='+this.value)"> <?echo $varc?>
<input type="text" name="direccion" id="cur_code" /> <input type="text" name="telefono" id="cur_code2" />
Archivo find_ccode.php:
Código PHP:
Ver original<?php
$nombre=$_REQUEST['nombre'];
if (!$con)
{
}
$sql="SELECT * FROM usuarios WHERE nombre = '".$nombre."'";
{
echo $row['direccion'];
echo $row['telefono'];
}
?>
El problema que tengo es que no puedo hacer que se dividan los datos direccion y telefono en los distintos textbox