Almost there ;)
I´m trying to implement Jquery Autocomplete to an input field.
HTML
<input type="text" id="objekt_nr">
JS
$(function() {
$( "#objekt_nr" ).autocomplete({
source: 'php/ajaxGetObjNr.php',
minLength: 3,
});
});
PHP
$return = array();
while ($row = $stmt->fetch()) {
$return[] = $row;
}
echo json_encode($return);
Result in Browser Console
[{objekt_nr: "22133-01"}, {objekt_nr: "22135-13-3"}, {objekt_nr: "22135-2-4"},…]
But when i type for ex: 221 in the input field, it suggest alot of empty white lines...
Why is that?
In the autocomplete docs it says its compatibale with Json?!