Skip to content Skip to sidebar Skip to footer

Google Maps V3 Autocomplete Input Jquery Mobile

I'm trying to get the autocomplete to work on a simple input text box. I have it working for one text box, but I have a second (to and from location) which it is throwing errors.

Solution 1:

I changed my approach. Since I already have all the geocode information in the application I really just wanted to populate the text boxes. I added this code to the initialize function which does as I would like.

 var inputStart = document.getElementById('from');
        var inputDestination = document.getElementById('to');
        var options = {componentRestrictions: {country: 'ca'}};                 
        new google.maps.places.Autocomplete(inputStart, options);
        new google.maps.places.Autocomplete(inputDestination, options);

Post a Comment for "Google Maps V3 Autocomplete Input Jquery Mobile"