I want to make auto complete text box for select employee names from the database. I don\'t have fair idea about that. But I tried to make it as following.
autocomplete
you need to bind your input to the onchange action
Use this
$(document).ready(function(){
$("#typeahead").change(function(event){
var query = document.getElementById('typeahead').value;
jQuery.ajax({
url: 'autocomplete.php',
type:'POST',
data:{'query':query},
dataType: 'JSON',
cache:false,
success:function(data){
// Do Anything You want here
},
error:function(){
// Do something else here
}
});
});
});