Combobox y caja de texto....
Publicado por Pepe (15 intervenciones) el 15/08/2007 17:21:46
Hola amigos , tengo poco de haberme iniciado en el amplio mundo de AJAX, por lo q necesito su ayuda , tengo la necesidad de llenar 3 cajas de texto al seleccionar una opcion de un combo , lo q estoy haciendo (y obviamente esta mal) es lo siguiente
------------------ archivo getusr.php
---------
Y ASI ES COMO LO QUIERO MOSTRAR (SE QUE AQUI ESTA EL PROBLEMA)
---------
--------------------------------
ESTE ES EL CODIGO Q TENGO EN MI ARCHIVO .JS
---------------------------------
-------------------
ESPERO ME PUEDAN AYUDAR POR FAVOR.....
------------------ archivo getusr.php
1
2
3
4
5
6
7
8
9
10
11
12
13
<?php
$q=$_GET["c"];
$result = mysql_query("SELECT * FROM datos");
do {
if ( $q == $row_result['cveclientes'])
{
echo $row_result['nomrbed'];
echo $row_result['area'];
echo $row_result['teloext'];
break;
}
} while ($row_result = mysql_fetch_assoc($result));
?>
---------
Y ASI ES COMO LO QUIERO MOSTRAR (SE QUE AQUI ESTA EL PROBLEMA)
---------
1
2
3
<input id="txtHint" name="nombred" type="text" readonly="true">
<input id="txtHint" name="area" type="text" readonly="true">
<input id="txtHint" name="teloext" type="text" readonly="true">
--------------------------------
ESTE ES EL CODIGO Q TENGO EN MI ARCHIVO .JS
---------------------------------
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var xmlHttp
function showHint(str)
{
if (str.length==0)
{
document.getElementById("txtHint").innerHTML=""
return
}
xmlHttp=GetXmlHttpObject() //ESTA FUNCION ESTA BIEN
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
var
url="getusr.php"
url=url+"?c="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function stateChanged()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById("txtHint").innerHTML=xmlHttp.responseText
}
}
-------------------
ESPERO ME PUEDAN AYUDAR POR FAVOR.....
Valora esta pregunta


0