Skip to content Skip to sidebar Skip to footer

Jquery:autocomplete Values And Categories.error: This.source Is Not A Function

Here is the part of my Javascript: $(function(){ var dbTags=; var myTag; $('#searchTags').autocomplete({ source: dbTags, minLeng

Solution 1:

If you're following the example you linked you want your "source" array to be an array of objects with "label" and "category" properties. I'm not sure what your PHP output is, or what database api you're using (assuming PDO), but I would try:

$findNames=$user_home->runQuery("SELECT productTitle, category from Products");
$findNames->execute();
while ($row=$findNames->fetch()){
 $namesArray[] = array("label" => $row['productTitle'], "category" => $row['category']);
}

Post a Comment for "Jquery:autocomplete Values And Categories.error: This.source Is Not A Function"