Hi
Can any one please help me on the below issue.
i can able to display values for texbox. but i don't know how to load the values for
<div id='txtHint' name='ptype'></div>
and if i change any value in conn_type it has to display.
test.php
<form action="<?php $_PHP_SELF ?>" method="post" enctype="multipart/form-data">
<table>
<tr>
<td>Line Number</td>
<td><input type='text' name='flag_seq' required id='flag_seq'/></td>
</tr>
<tr>
<td>Connection Type</td>
<td><input type='text' name='conn_type' id='conn_type' onChange='showptype(this.value)'></td>
</tr>
<tr>
<td>Type</td>
<td><div id='txtHint' name='ptype'></div></td>
</tr>
</table>
</form>
<script type="text/javascript">
function showptype(str1)
{
if (str1=="")
{
document.getElementById("txtHint").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("txtHint").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","getptype.php?q="+str1,true);
xmlhttp.send();
}
</script>
getptype.php
$q=strtoupper($_GET['q']);
$query="select * from $database.FQ64006 WHERE SCYQ64CTYPE='$q'";
$result = oci_parse($connection,$query);
oci_execute ($result,OCI_DEFAULT);
$ex1=oci_fetch_array($result,OCI_BOTH);
if($q!='')
{
?>
<input type="text" name="ptype" id="ptype" value="<?php $SCYQ64TYPE1 = $ex1["SCYQ64TYPE"]; echo $SCYQ64TYPE = trim($SCYQ64TYPE1) ?>" readonly >
<?php } ?>