hi,
i created a acf field addon where i get the current geolocation.
the user clicks a button <button id=”btnFind”>Where am i?</button> which triggers a function (navigator.geolocation.getCurrentPosition) and recieves the current position coordinates. this works fine.
but i also have other acf fields which are required.
somehow as soon as i click the “where am i?” button, all the required fields which are not filled, an error message is shown.
is it possible to click the “where am i?” button without having this issue?
thanks
never mind, the solution is very simple.
if you add type=’button’ to the button, the page does not get refreshed
Or, in your javascript, make sure the form does not submit
e.preventdefault();