autocomplete jquery php

Solutions on MaxInterview for autocomplete jquery php by the best coders in the world

showing results for - "autocomplete jquery php"
Leonardo
29 Sep 2017
1// AJAX call for autocomplete 
2$(document).ready(function(){
3	$("#search-box").keyup(function(){
4		$.ajax({
5		type: "POST",
6		url: "readCountry.php",
7		data:'keyword='+$(this).val(),
8		beforeSend: function(){
9			$("#search-box").css("background","#FFF url(LoaderIcon.gif) no-repeat 165px");
10		},
11		success: function(data){
12			$("#suggesstion-box").show();
13			$("#suggesstion-box").html(data);
14			$("#search-box").css("background","#FFF");
15		}
16		});
17	});
18});
19//To select country name
20function selectCountry(val) {
21$("#search-box").val(val);
22$("#suggesstion-box").hide();
23}