How to detach input element from auto-grabbing place in Google Places API

I have added an input element where google places autoload and it works fine for me. My question is, how can I strip off an element in javascript or jquery so that after detaching when I type in this field, I don't get auto-completion.

I used the following code to attach an input element:

var options  = {types: ['establishment']};
var input    = document.getElementById('businessname');
autocomplete = new google.maps.places.Autocomplete(input, options);

      

I tried to remove the autocomplete object. But I still get suggestions when I enter businessname in the field.

Please help as soon as possible.

+3


source to share





All Articles