Dear friends,
I am coding with PHP and using AJAX to read post data read from MySQL to controls on PHP page.
But I have a small problem.

I can connect to MySql and read a field in a table, post the entire data of that field to the ComboBox Control on PHP page without re-loading the page (i.e., isPostBack=false).
Pls see the code below:

Explanation:
From an AJAX script, it uses a php file (getparish-details.php) with a string variable (strPar) and a key (parish_d).
When you select an item in a combo box, the onChange() event of the combo box calls the AJAX function and passes the value of your selection to the key of the function.
The function opens the php file getparish-details.php and reads the specified data from the mysql table.
When you read data from mysql, the getparish-details passes the data to strPar and
the document.getElementById("txtaddress").innerHTML=""; declaration posts the data to the control whose 'id' is declared in document.getElemetById.
This will automatically call data from the database without re-loading the php page.
However, I have only been able to do this with combo box controls.
The problem I have is;
I want to post data to textbox controls instead of combo box. But I am having problems.
Pls can you assist me.

Thank you!

Code:
<script type="text/javascript">
<!--
// JavaScript Document
function loadparish_details(strPar)
{
if (strPar=="")
  {
  document.getElementById("txtphone").innerHTML="";
  document.getElementById("txtpic").innerHTML="";
  document.getElementById("txtaddress").innerHTML="";
  return;
  } 
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("txtphone").innerHTML=xmlhttp.responseText;
	document.getElementById("txtpic").innerHTML=xmlhttp.responseText;
	document.getElementById("txtaddress").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","getparish-details.php?parish_d="+strPar,true);
xmlhttp.send();
}
</script>
getparish-details.php
Code:
<?php
$qd=$_GET["parish_d"]; //qd is a variable that holds a key.
//$province=$_GET['province'];
//$region=$_GET["region"];

$parish_dt = mysql_query("SELECT pic_name, address, phone FROM parish WHERE parish_name='$qd'");
//echo "<Select id='txtpro' name='province' size='1'> ";
while($row = mysql_fetch_array($parish_dt)){
//echo $row['address'];
echo '<input type="text" name="address" value="'.$row['address'].'" size="70" /><br /><br />';
//echo '<option value="'. $row['address'].'">' . $row['address'].'</option>'; } 

//echo "</select> ";
//echo $combine;
?>