I have a php file that reads data from my mysqldb as a json array. The data should be displayed if the user types in 3 characters.
JS:
<link rel="stylesheet" href="js/demos.css"> //JQuery AutoSuggest Css
<script>
$(function() {
var availableTags = <?php include("/php/getAllRecipes.php"); ?>;
$( "#searchrecipes" ).autocomplete({
source: availableTags
});
});
</script>
<input id="searchrecipes" type="text" name="searchrecipes" class="searchinput" style="margin-left: 850px; margin-top: 0px; width:170px; background: #fff url(images/search_icon.png) no-repeat 100%;" placeholder="Suchen..."></input>
<input type="submit"1 name="buttonsenden" style="display:none;" value="" width: 5px></input>
Problem:
We have to get the data into the array in our JS calles "availableTags".