Forum: Gravity Geolocation

This forum is closed for new topics. However, you can still search for a solution in the old topics. For technical support related to the Gravity Geolocation premium extension please open a new premium support ticket.

[Resolved]Where to hook js on change/use of locatorButton, markerDrag, or address entry

Home Forums Gravity Geolocation Where to hook js on change/use of locatorButton, markerDrag, or address entry

This topic contains 1 reply, has 2 voices, and was last updated by  Eyal Fitoussi 3 years, 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #53249

    Peter
    Participant

    I’m using your Geolocation for Gravity Forms.

    I have some custom jQuery that needs to execute anytime the user sets the map marker via dragging it, and whenever the users enters an address, and whenever the user uses the locator button. Which hook/filter can i use to achieve that? Can you help me construct it? Does it need any paramaters?

    Ultimately, dragging the map marker, entering an address, and using the locator button seems to update the Latitude and Longitude fields on the form (e.g. the Coordinates). My jQuery function relies on these updated values because it does something with the values. As such, can you advise where to hook my Jquery into so that it runs after each of these 3 interactions? My attempt below at listening to a change of these values is not ideal as my code below relies on a human to make the change via the UI directly to those fields. What I really want is to use your hooks to execute my custom logic instead of relying on the .onchange event.

    document.getElementById(“input_1_24_longitude”).onchange = function() {
    console.log(“Changed!”);
    var latvalue = document.getElementById(“input_1_24_latitude”);
    var longvalue = document.getElementById(“input_1_24_longitude”);
    document.getElementById(“input_1_31”).value = latvalue.value + “, ” + longvalue.value;

    }

    document.getElementById(“input_1_24_latitude”).onchange = function() {
    var latvalue = document.getElementById(“input_1_24_latitude”);
    var longvalue = document.getElementById(“input_1_24_longitude”);
    document.getElementById(“input_1_31”).value = latvalue.value + “, ” + longvalue.value;
    }

    </script>

    #53252

    Eyal Fitoussi
    Keymaster

    Hello Peter,
    There is no such hook available at the moment. However, I can try to add a new hook, which you could probably use, and release a new version over the weekend.

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

You must be logged in to reply to this topic.