KoolAutoComplete supports item template, in which we can define our own item's display. To use this feature, you need to set your template to itemTemplate property of KoolAutoComplete instance. Above example show you how to add image to item.
When an item is rendered, KoolAutoComplete will read the itemTemplate and start fill in data to placeholder of template.
<?php
require $KoolControlsFolder."/KoolAutoComplete/koolautocomplete.php";
$kac = new KoolAutoComplete("kac");
$kac->scriptFolder = $KoolControlsFolder."/KoolAutoComplete";
$kac->width = "160px";
$kac->attachTo = "txtRegion";
$kac->styleFolder="default";
$result = mysqli_query($db_con, "select CountryName,FlagImage from kcb_tbcountries");
while($row = mysqli_fetch_assoc($result))
{
$kac->addItem($row["CountryName"],array("image"=>$row["FlagImage"]));
}
$kac->itemTemplate ="<table><tr><td valign='middle' style='width:22px;height:20px;'><img src='../../../KoolComboBox/Resources/Flags/{image}' alt='{text}' title='{text}' /></td><td valign='middle'>{text}</td></tr></table>";
?>
<form id="form1" method="post">
<div style="padding-left:10px;padding-bottom:10px;">
Enter your country name:
<input type="text" id="txtRegion" autocomplete='off' />
<?php echo $kac->Render();?>
</div>
</form>