<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<script>
    function doCustCallAjax(cName,cNo) {
		HttPRequest = false;
		if (window.XMLHttpRequest) { // Mozilla, Safari,...
			HttPRequest = new XMLHttpRequest();
			if (HttPRequest.overrideMimeType) {
				HttPRequest.overrideMimeType('text/html');
			}
		} else if (window.ActiveXObject) { // IE
				try {
						HttPRequest = new ActiveXObject("Msxml2.XMLHTTP");
					 } catch (e) {
										try {
										HttPRequest = new ActiveXObject("Microsoft.XMLHTTP");
										} catch (e) {}	
									 }
				}
		if (!HttPRequest) {
			alert('Cannot create XMLHTTP instance');
			return false;
		}	
		var url = 'GetFillCustomer.php';
		var pmeters = 'tcName=' + encodeURI(document.getElementById(cName).value);
		HttPRequest.open('POST',url,true);
		HttPRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		HttPRequest.setRequestHeader("Content-length", pmeters.length);
		HttPRequest.setRequestHeader("Connection", "close");
		HttPRequest.send(pmeters);
		HttPRequest.onreadystatechange = function()
		{
			//if(HttPRequest.readyState == 3)  // Loading Request
			//{
			//document.getElementById(fProductName).innerHTML = "..";
			//}
			if(HttPRequest.readyState == 5) // Return Request
			{
				var myName = HttPRequest.responseText;
				if(myName != "")
				{
					var myArr = myName.split("|");
					document.getElementById(cName).value = myArr[0];
					document.getElementById(cNo).value = myArr[1];        
				}
			}
		}
	}
</script>    
<body>
<input list="brow">
<datalist id="brow" name="brow" id="cName"
         OnChange="JavaScript:doCustCallAjax('cName','cNo');">
  <?php
    $con = @mysqli_connect("localhost", "root", "abc456", "ProudAsiaDB") 
				 or die(mysqli_connect_error());
				 mysqli_query($con,"set names utf8"); 
   
    $sql = "select * FROM cust001 ORDER BY C_NAME ASC";
    $query = mysqli_query($con,$sql);
    while($result = mysqli_fetch_array($query)){
      if($strDefault == $result["C_NAME"]){
          $sel = "selected";}
      else{$sel = "";}
  ?>    
    <option><?php echo $search=$result["C_NAME"]; ?></option>
  <?php } 
           
    ?>
</datalist>
</body>
</html>