I have text input with "geocomplete" on my web page. Every keyPress event sends request to GoogleMaps API. I would like to change this behavior in the way that request is sent each 3 character (not each letter) or set delay before request.
I tried to use geocode:beforegeocomelete_search event but it does not work.
$("input").geocomplete()
.bind("geocode:beforegeocomelete_search", function(event, results){
if ( $("input").val().length < 4) {
throw "At least 3 characters required for request sending";
}
});
Do you have any ideas on the matter?
Not sure which version of geocomplete you are using. The version at https://github.com/ubilabs/geocomplete/ has a
trigger()which you can call when theinputmeets thelengthrequirements.Note: the external lib does not seem to be loading in the snippet for some reason.