Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have a web form in which I have a textbox attached to a google places autocomplete. This works fine. What I want to do is save the value that the autocomplete stores in the textbox to a BD, and later on be able to show the form filled with the values stored in the BD.

try {
acOrigem = new google.maps.places.Autocomplete($("#txtAdressORI")[0], {});
google.maps.event.addListener(acOrigem, 'place_changed', function () { CreateMap(); });


C#
function CreateMap() {
    var placeORI = acOrigem.getPlace();


This works fine. The issue is that when I do:

document.getElementById("txtAdressORI").value = "Lisboa,Portugal";
google.maps.event.trigger(acOrigem, 'place_changed');


The function is triggered correctly but the place is not recognized(i.e. getPlace() returns Null).


Does anyone have any Idea on how to achieve this?

Thanks
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900