Dear friends,
I need help on this problem please.
I have an AJAX function that calls data from mysql with a php file, then onChange event of a dropdown item, the function is executed. The called data to be loaded on other text box controls in the calling php page.

However, the script below works well with loading data to dropdown listbox but does not work with text boxes.
Pls find code below:

AJAX script:

Code:
<script>
function showDetails(str2)
{
if (str2=="")
  {
  document.getElementById("txtAddress").innerHTML="";
  document.getElementById("txtpic").innerHTML="";
  document.getElementById("txtphone").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("txtAddress").innerHTML=xmlhttp.responseText;
	document.getElementById("txtpic").innerHTML=xmlhttp.responseText;
	document.getElementById("txtphone").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","getparish-details.php?parish="+str2,true);
xmlhttp.send();
}
</script>
HTML that has the controls
HTML Code:
HTML Code:
<select name="parish" id="txtparish" size="1" onchange="showDetails(this.value)">
</select>

<b style="color:#990000"> Parish Address : *</b><br />
<input type="text" name="pic" id="txtAddress" class="passwordEntry" />
<b style="color:#990000"> Name of PIC : *</b>
<input type="text" name="pic" id="txtpic" class="passwordEntry" />
<br />
<br />
<b style="color:#990000">Contact Phone Numbers :</b> <br />
<input type="text" name="pic" id="txtphone" class="passwordEntry" />
PHP file getparish-details.php

PHP Code:
PHP Code:

<?php session_start();



include_once (
"../db/connString2.php");







if (!
$con=mysql_connect($server,$server_user,$server_pass)) {



die(
'Could not connect: ' mysql_error()); } 



elseif(!
mysql_select_db($db_name$con)) {



die(
"Could not connect to the database: " mysql_error()); }







else {







}



?>







<?php



$q
=$_GET["parish"];



//$q="CTL Central Parish";


$parish mysql_query("SELECT area, parish_name, pic_name, address, phone FROM parish WHERE parish_name='$q'");
while(
$row mysql_fetch_array($parish))
{

//echo "This is the address of the Church<br />";

echo $row['address'];
echo 
$row['pic_name'];
echo 
$row['phone'];

//echo $row['address'];

//echo '<input name="txtaddress" type="text" size="75" Readonly value="'.$row['address'].'">';

}

mysql_close($con);
?>