Witam,
chce napisać autocomplete do textboxa, przeglądałem już sporo stron jak to zrobić, ale niestety się nie udało. Póki co mam coś takiego i to działa:
var regions = ['Eastern', 'Western', 'Northern', 'Southern'];
$(document).ready(function () {
//Adding autocomplete to region input
$("#region").autocomplete(regions, {
//Minimum number of characters a user has to type before the autocompleter activates
minChars: 0,
//The number of items in the select box
max: 4,
//Fill the input while still selecting a value
autoFill: true,
//Only suggested values are valid
mustMatch: true,
//The comparison doesn't looks inside
matchContains: false
});
});
Jednak tutaj dane są podane na sztywno przez javascript. Ja chcę pobrać te dane z bazy danych i nie bardzo wiem jak to zrobić... <help>