Support

Account

Home Forums Front-end Issues Using Maps field in the front-end form

Solving

Using Maps field in the front-end form

  • Hello!

    I have one question concerning Map field.

    I’ve added a front-end form to add a post using acf_form().

    But I can’t get the Map field work (API key is missing).

    I’ve added this code with my API key to fuctions.php

    function my_acf_init() {
    	
    	acf_update_setting('google_api_key', 'xxx');
    }
    
    add_action('acf/init', 'my_acf_init');

    But nothing changed. Field works as it should in the dashboard but it doesn’t work in the front end.

    What am I doing wrong?

  • Hi @tormeneus

    Please make sure that you have set the key correctly. To get the key, kindly check this page: https://developers.google.com/maps/documentation/javascript/get-api-key#key. Don’t forget that you need to add the acf_form_head() on top of your template. This page should give you more idea about it: https://www.advancedcustomfields.com/resources/create-a-front-end-form/.

    Also, could you please let me know the version of your ACF?

    Thanks 🙂

  • Hello,
    I’ve the same problem with ACF 5.5.3
    I’ve to click on the magnifying glass to search the address, then adress is stored. But there’s no live search as in BO

  • Hi @sebastienserre

    Could you please make sure that there’s no conflict on your site? Could you please try to reproduce the issue on one of the WordPress’ stock themes (like Twenty Sixteen) with other plugins deactivated? If it disappears, then you can activate the theme and plugins one by one to see which one causes the issue.

    Also, please don’t forget that you need to set the Google Maps API correctly.

    Thanks 🙂

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Using Maps field in the front-end form’ is closed to new replies.