本文介绍了谷歌的问题是自动填充功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我有一个网页表单,其中我有一个文本框附加到谷歌地方自动完成。这很好用。我想要做的是将自动完成存储在文本框中的值保存到BD,然后能够显示填充了存储在BD中的值的表单。 尝试{ acOrigem = new google.maps.places.Autocomplete($(#txtAdressORI)[0],{}); google。 maps.event.addListener(acOrigem,''place_changed'',function(){CreateMap();}); function CreateMap(){ var placeORI = acOrigem.getPlace(); 这样可行。问题 我执行: document.getElementById( txtAdressORI)。 value = Lisboa,Portugal; google.maps。 event .trigger(acOrigem,' place_changed'); 函数被正确触发,但无法识别该位置(即getPlace()返回Null)。 有没有人知道如何实现这个目标? 谢谢解决方案 (#txtAdressORI)[0],{}); google.maps.event .addListener(acOrigem,''place_changed'',function(){CreateMap();}); function CreateMap(){ var placeORI = acOrigem.getPlace(); 这样可行。问题 我执行: document.getElementById( txtAdressORI)。 value = Lisboa,Portugal; google.maps。 event .trigger(acOrigem,' place_changed'); 函数被正确触发,但无法识别该位置(即getPlace()返回Null)。 有没有人知道如何实现这个目标? 谢谢 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(); });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 解决方案 ("#txtAdressORI")[0], {}); google.maps.event.addListener(acOrigem, ''place_changed'', function () { CreateMap(); });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 这篇关于谷歌的问题是自动填充功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-21 03:15