i use jquey autocomplete for autosuggestion.I use min_length:3 because i want that when user type 3 characters then it show the sugestion.But it is not working properly.Sometimes it show suggestion after typing 1 character.My code is given:
$("#state").autocomplete({
source: function(request, response) {
$.ajax({
url: "autocomp3.asp",
dataType: "json",
data: {
term : request.term,
tbl_name : "UserAccounts",
ID : "accID",
Value : "accFirstName"
},
success: function(data) {
response(data);
}
});
},
min_length: 3,
delay: 300
});
Help is needed.
What I have tried:
$(function() {
$("#state").autocomplete({
// var str : $("#state").val(),
source: function(request, response) {
$.ajax({
url: "autocomp3.asp",
dataType: "json",
data: {
term : request.term,
tbl_name : "UserAccounts",
ID : "accID",
Value : "accFirstName"
//country_id : $("#country_id").val()
},
success: function(data) {
response(data);
}
});
},
min_length: 3,
delay: 300
});
});