Forums › Gravity Geolocation › No autocomple
- This topic has 29 replies, 3 voices, and was last updated 6 years, 6 months ago by
Eyal Fitoussi.
-
AuthorPosts
-
January 15, 2016 at 3:47 am #50044
Chris Homan
MemberMaybe my expectations are wrong but I have an issue with autocomplete. I created a simple form (see private content) and it works well when I drag the marker to a spot but does nothing with the address field. The fields get populated with an address when dragging the marker but when entering an address the map doesn’t change and no autocomplete suggestions are made. I tried many different address field configurations and the same thing happens. I also tried it with different custom field settings and enabling/disabling pretty much any checkbox on the form. To be hones, I’m really getting frustrated by this all…
Private Content HiddenJanuary 15, 2016 at 3:35 pm #50055Eyal Fitoussi
MemberHello Chris and thank you for the purchase.
There are two JavaScript errors generated on that page. One of the errors indicates that there are multiple called made to Google Maps API.
Is there another mapping plugins installed on your site? If so please deactivate it and try the form again to see if it then works. If it does work please let me know which plugin that was.
Thanks
January 15, 2016 at 11:04 pm #50061Chris Homan
MemberHi Eyal,
I had seen that too. I tried different configurations to check if this was the problem
1) Dequeue your API script (handler: google-maps, correct?)
2) Dequeue the other script
3) Dequeue all geo scripts and enqueued a new Google Maps API script
4) Deactivate the other pluginNeither of these options solved the problem.
January 15, 2016 at 11:07 pm #50062Eyal Fitoussi
MemberThank you.
Can you please deactivate the other plugin only and let me know once you do so I could take look at the page again?January 15, 2016 at 11:13 pm #50063Chris Homan
MemberDone, you can have a look now.
January 15, 2016 at 11:17 pm #50065Eyal Fitoussi
MemberThanks again.
I see where the issue is. Can you make a small change in the JavaScript file until I release an official fix? I will explain you where and what to change.January 15, 2016 at 11:18 pm #50066Chris Homan
MemberThat would be great, thanks, I can edit it right now
January 15, 2016 at 11:24 pm #50068Eyal Fitoussi
MemberGreat.
1) Open the filegravityforms-geolocation/assets/js/gfg.js
and copy the entire content.
2) Open the filegravityforms-geolocation/assets/js/gfg.min.js
and replace the content of this file with the content from the first file.
3) In gfg.min.js remove the lines 392 – 410 ( might not be the exact lines for you but very close ) which should be:1234567891011121314151617gform.addAction( 'gform_post_conditional_logic_field_action', function (formId, action, targetId, defaultValues, isInit) {// only if logic trigger set to showif ( !isInit && action == 'show' ) {var target = jQuery(targetId),coupon_items = target.find('div#ggf-map');if ( coupon_items.length ) {// resize mapgoogle.maps.event.trigger( GF_Geo.map.map, 'resize' );// center markerGF_Geo.map.map.panTo( GF_Geo.map.marker.position );}}});4) Save the file and test the form.
January 15, 2016 at 11:33 pm #50069Chris Homan
MemberDone, tried it but am getting two error messages:
1) Uncaught ReferenceError: gform is not defined
2) Google Maps API warning: InvalidKey: https://developers.google.com/maps/documentation/javascript/error-messagesI have no API key defined at the moment (still struggling to get the correct API key from Google, getting confused by all their options…)
January 15, 2016 at 11:42 pm #50071Chris Homan
MemberDone, misread your instructions (copy & pasted instead of delete). Minified it and all works perfectly. THANKS!!!
Private Content HiddenJanuary 15, 2016 at 11:48 pm #50072Chris Homan
MemberAn odd error is occurring now. When I submit the post it creates a duplicate post…
January 15, 2016 at 11:50 pm #50073Eyal Fitoussi
MemberYou are welcome. I will try to release an official fix during the weekend as I am working on few other issues with the plugin.
regarding the API key, it is no longer required for Google Maps API to work. The warning that you see regarding the API key invalid ( not the errors message you get about the multiple API calls ) should not effect the functionality of your site and I will look into removing the warning in the coming version.
If you want to try and remove the warning open the file gravityforms-geolocation/gravityforms-geolocation.php and remove line 186 should be
1'key' => '',I am not sure it will do but it might.
January 15, 2016 at 11:53 pm #50075Eyal Fitoussi
MemberAn odd error is occurring now. When I submit the post it creates a duplicate post…
I don’t think that the last change that you did created this issue. I actually never experience this kind of issue. Can you check what causes it?
January 15, 2016 at 11:58 pm #50076Chris Homan
MemberI’ll look into it. It doesn’t happen without your plugin but I cannot say for sure it’s caused by it. I will do some digging and let you know if it is related. If you want to have a look yourself, I can also give you admin access to the site.
January 16, 2016 at 12:31 am #50077Chris Homan
MemberHi Eyal,
I’ve done some troubleshooting and I’m certain the duplicates are related to your plugin. When I use the form and enter no geo related data, only one post is created. But when I add a location, a duplicate is created. Very odd…
-
AuthorPosts
The topic ‘No autocomple’ is closed to new replies.